Sprinkle Qt::SmoothTransformation everywhere

This commit is contained in:
Nicolas Mailloux 2023-06-25 17:47:02 -04:00
parent 2181410904
commit 9da168fc7e
7 changed files with 25 additions and 25 deletions

View file

@ -51,28 +51,28 @@ encryptionManager::encryptionManager(QWidget *parent) :
stdIconWidth = sW / 1.50;
stdIconHeight = sH / 1.50;
QPixmap pixmap(":/resources/encryption.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->encryptionImageLabel->setPixmap(scaledPixmap);
}
{
stdIconWidth = sW / 1.65;
stdIconHeight = sH / 1.65;
QPixmap pixmap(":/resources/check-display.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->checkImageLabel->setPixmap(scaledPixmap);
}
{
stdIconWidth = sW / 1.65;
stdIconHeight = sH / 1.65;
QPixmap pixmap(":/resources/error.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->failureImageLabel->setPixmap(scaledPixmap);
}
{
stdIconWidth = sW / 1.50;
stdIconHeight = sH / 1.50;
QPixmap pixmap(":/resources/alert-triangle.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->warningImageLabel->setPixmap(scaledPixmap);
}

View file

@ -284,31 +284,31 @@ MainWindow::MainWindow(QWidget *parent)
int quote_value = display_quote();
if(quote_value == 1) {
QPixmap pixmap(":/resources/chesterton.jpg");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->quotePictureLabel->setPixmap(scaledPixmap);
ui->quoteLabel->setText("“A good novel tells us the truth about its hero; but a bad novel tells us the truth about its author.”\n― G.K. Chesterton");
}
if(quote_value == 2) {
QPixmap pixmap(":/resources/alcott.jpg");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->quotePictureLabel->setPixmap(scaledPixmap);
ui->quoteLabel->setText("“I've got the key to my castle in the air, but whether I can unlock the door remains to be seen.”\n― Louisa May Alcott");
}
if(quote_value == 3) {
QPixmap pixmap(":/resources/king.jpg");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->quotePictureLabel->setPixmap(scaledPixmap);
ui->quoteLabel->setText("“Quiet people have the loudest minds”\n― Stephen King");
}
if(quote_value == 4) {
QPixmap pixmap(":/resources/davies.jpg");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->quotePictureLabel->setPixmap(scaledPixmap);
ui->quoteLabel->setText("“Authors like cats because they are such quiet, lovable, wise creatures, and cats like authors for the same reasons.”\n― Robertson Davies");
}
if(quote_value == 5) {
QPixmap pixmap(":/resources/christie.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->quotePictureLabel->setPixmap(scaledPixmap);
ui->quoteLabel->setText("“One of the saddest things in life, is the things one remembers.”\n― Agatha Christie");
}

View file

@ -365,13 +365,13 @@ reader::reader(QWidget *parent) :
float stdIconWidth = sW / 19;
float stdIconHeight = sH / 19;
QPixmap chargingPixmap(":/resources/battery_charging.png");
scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap fullPixmap(":/resources/battery_full.png");
scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap halfPixmap(":/resources/battery_half.png");
scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap emptyPixmap(":/resources/battery_empty.png");
scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
// Checking if there is a page refresh setting set

View file

@ -29,13 +29,13 @@ alert::alert(QWidget *parent) :
// Default icon in case none of the conditions below are met
QPixmap pixmap(":/resources/alert.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->alertIconLabel->setPixmap(scaledPixmap);
// Checking if the update's signature is untrusted. The signature error will always take precedence over the downgrade one (c.f. update.sh script)
if(checkconfig("/external_root/boot/flags/ALERT_SIGN") == true) {
QPixmap pixmap(":/resources/alert.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->alertIconLabel->setPixmap(scaledPixmap);
signatureError = true;
@ -46,7 +46,7 @@ alert::alert(QWidget *parent) :
}
if(checkconfig("/external_root/boot/flags/ALERT_DOWNGRADE") == true) {
QPixmap pixmap(":/resources/alert.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->alertIconLabel->setPixmap(scaledPixmap);
log("Displaying downgrade error alert splash", className);
@ -59,7 +59,7 @@ alert::alert(QWidget *parent) :
ui->stackedWidget->setVisible(false);
ui->stackedWidget->deleteLater();
QPixmap pixmap(":/resources/alert.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->alertIconLabel->setPixmap(scaledPixmap);
ui->warningLabel->setText("Fatal error");
@ -76,7 +76,7 @@ alert::alert(QWidget *parent) :
ui->stackedWidget->deleteLater();
QPixmap pixmap(":/resources/battery_alert.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->alertIconLabel->setPixmap(scaledPixmap);
log("Displaying critical battery alert splash", className);

View file

@ -42,7 +42,7 @@ usbmsSplash::usbmsSplash(QWidget *parent) :
}
QPixmap pixmap(":/resources/kobox-icon.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->label_2->setPixmap(scaledPixmap);
}
else {
@ -54,7 +54,7 @@ usbmsSplash::usbmsSplash(QWidget *parent) :
ui->label_3->setStyleSheet("QLabel { background-color : black; color : white; font-size: 10pt }");
QPixmap pixmap(":/resources/usbms.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->label_2->setPixmap(scaledPixmap);
}
@ -144,7 +144,7 @@ void usbmsSplash::usbmsLaunch()
float stdIconHeight = sH / 2;
QPixmap pixmap(":/resources/clock-inverted.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->label_2->setPixmap(scaledPixmap);
this->repaint();

View file

@ -47,7 +47,7 @@ bookInfoDialog::bookInfoDialog(QWidget *parent) :
global::library::bookId = readFile(idPath).toULong();
QPixmap coverPixmap(coverPath);
QPixmap scaledCoverPixmap = coverPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledCoverPixmap = coverPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->bookCoverLabel->setPixmap(scaledCoverPixmap);
global::library::isLatestBook = false;
@ -64,7 +64,7 @@ bookInfoDialog::bookInfoDialog(QWidget *parent) :
if(QFile::exists("/inkbox/gutenberg/getCoverDone")) {
if(checkconfig("/inkbox/gutenberg/getCoverDone") == true) {
QPixmap coverPixmap("/inkbox/gutenberg/book_cover.jpg");
QPixmap scaledCoverPixmap = coverPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledCoverPixmap = coverPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->bookCoverLabel->setPixmap(scaledCoverPixmap);
QFile::remove("/inkbox/gutenberg/getCoverDone");
break;

View file

@ -21,14 +21,14 @@ hourglassAnimationWidget::hourglassAnimationWidget(QWidget *parent) :
stdIconWidth = sW / 2.5;
stdIconHeight = sH / 2.5;
QPixmap pixmap(":/resources/hourglass-top.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->hourglassTopLabel->setPixmap(scaledPixmap);
}
{
stdIconWidth = sW / 2.5;
stdIconHeight = sH / 2.5;
QPixmap pixmap(":/resources/hourglass-bottom.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->hourglassBottomLabel->setPixmap(scaledPixmap);
}