From 5648b6351a1def893cd3149002c17a170419c628 Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Wed, 14 Jun 2023 23:39:33 -0400 Subject: [PATCH] UI fonts standardization in some areas --- src/settings/powerdaemonsettings.cpp | 14 +++++++------- src/widgets/dialogs/brightnessdialog.cpp | 9 +-------- src/widgets/dialogs/brightnessdialog.ui | 5 +++-- src/widgets/dialogs/generaldialog.ui | 5 +++++ src/widgets/dialogs/kobox/koboxappsdialog.cpp | 13 +++---------- src/widgets/reader/dictionarywidget.cpp | 1 - 6 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/settings/powerdaemonsettings.cpp b/src/settings/powerdaemonsettings.cpp index 0011f70..39ff48e 100644 --- a/src/settings/powerdaemonsettings.cpp +++ b/src/settings/powerdaemonsettings.cpp @@ -13,8 +13,8 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) : ui->mainLabel->setFont(QFont("Inter")); // Avoid some display issues (label moving because width of text would change with a proportional font) - ui->CBSLabel->setFont(QFont("Noto Sans Mono")); - ui->idleSleepLabel->setFont(QFont("Noto Sans Mono")); + ui->CBSLabel->setFont(QFont("Roboto Mono")); + ui->idleSleepLabel->setFont(QFont("Roboto Mono")); // Font tweaks ui->label_2->setFont(QFont("Inter")); @@ -67,10 +67,10 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) : // Padding ui->CBSDecreaseBtn->setStyleSheet("padding: 10px; font-size: 10pt"); ui->CBSIncreaseBtn->setStyleSheet("padding: 10px; font-size: 10pt"); - ui->idleSleepDecreaseBtn->setStyleSheet("padding: 10px; font-size: 10pt"); - ui->idleSleepIncreaseBtn->setStyleSheet("padding: 10px; font-size: 10pt"); - ui->idleSleepDecreaseMBtn->setStyleSheet("padding: 10px; font-size: 10pt"); - ui->idleSleepIncreaseMBtn->setStyleSheet("padding: 10px; font-size: 10pt"); + ui->idleSleepDecreaseBtn->setStyleSheet("font-family: 'Roboto Mono'; font-weight: bold; padding: 10px; font-size: 10pt"); + ui->idleSleepIncreaseBtn->setStyleSheet("font-family: 'Roboto Mono'; font-weight: bold; padding: 10px; font-size: 10pt"); + ui->idleSleepDecreaseMBtn->setStyleSheet("font-family: 'Roboto Mono'; font-weight: bold; padding: 10px; font-size: 10pt"); + ui->idleSleepIncreaseMBtn->setStyleSheet("font-family: 'Roboto Mono'; font-weight: bold; padding: 10px; font-size: 10pt"); // Stylesheet QFile stylesheetFile("/mnt/onboard/.adds/inkbox/eink.qss"); @@ -403,7 +403,7 @@ void powerDaemonSettings::on_deepSleepBtn_clicked(bool checked) void powerDaemonSettings::convertCinematicInt() { QString text = QString::number(cinematicBrightnessInt); // To avoid moving other widgets when the value changes - text.append("ms"); + text.append(" ms"); ui->CBSLabel->setText(text); } diff --git a/src/widgets/dialogs/brightnessdialog.cpp b/src/widgets/dialogs/brightnessdialog.cpp index 2a0b35c..e00ad4c 100644 --- a/src/widgets/dialogs/brightnessdialog.cpp +++ b/src/widgets/dialogs/brightnessdialog.cpp @@ -32,7 +32,7 @@ brightnessDialog::brightnessDialog(QWidget *parent) : ui->incBtn->setProperty("type", "borderless"); ui->incBtn->setText(""); ui->incBtn->setIcon(QIcon(":/resources/plus.png")); - ui->brightnessLabel->setStyleSheet("font-size: 11pt; padding-left: 125px; padding-right: 125px; font:bold"); + ui->brightnessLabel->setStyleSheet("padding-left: 125px; padding-right: 125px; font:bold"); ui->valueLabel->setStyleSheet("font-size: 9pt"); ui->warmthValueLabel->setStyleSheet("font-size: 9pt"); @@ -101,13 +101,6 @@ brightnessDialog::brightnessDialog(QWidget *parent) : ui->warmthValueLabel->setText(warmthValueStr); } - // UI fonts - int id = QFontDatabase::addApplicationFont(":/resources/fonts/CrimsonPro-Bold.ttf"); - QString family = QFontDatabase::applicationFontFamilies(id).at(0); - QFont crimson_bold(family); - - ui->brightnessLabel->setFont(QFont(crimson_bold)); - // Saving current brightness value in case we want to go backwards if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) { oldValue = get_brightness(); diff --git a/src/widgets/dialogs/brightnessdialog.ui b/src/widgets/dialogs/brightnessdialog.ui index ef5a5f4..7c26fed 100644 --- a/src/widgets/dialogs/brightnessdialog.ui +++ b/src/widgets/dialogs/brightnessdialog.ui @@ -145,8 +145,9 @@ - Chivo - true + Inter + 75ı + true diff --git a/src/widgets/dialogs/generaldialog.ui b/src/widgets/dialogs/generaldialog.ui index 1d07d21..1923556 100644 --- a/src/widgets/dialogs/generaldialog.ui +++ b/src/widgets/dialogs/generaldialog.ui @@ -198,6 +198,11 @@ Where: + + + u001 + + diff --git a/src/widgets/dialogs/kobox/koboxappsdialog.cpp b/src/widgets/dialogs/kobox/koboxappsdialog.cpp index 2ad0c50..4b1fdd1 100644 --- a/src/widgets/dialogs/kobox/koboxappsdialog.cpp +++ b/src/widgets/dialogs/kobox/koboxappsdialog.cpp @@ -15,6 +15,7 @@ koboxAppsDialog::koboxAppsDialog(QWidget *parent) : ui(new Ui::koboxAppsDialog) { ui->setupUi(this); + ui->definitionLabel->setFont(QFont("u001")); ui->appsList->setFont(QFont("u001")); // Preventing outside interaction @@ -26,24 +27,16 @@ koboxAppsDialog::koboxAppsDialog(QWidget *parent) : this->setStyleSheet(stylesheetFile.readAll()); stylesheetFile.close(); - if(global::deviceID == "n705\n") { - // If we don't do this, the text will clip out of the display. - ui->definitionLabel->setText("Please select an application.\nClick on 'Launch' to start it."); - } + ui->definitionLabel->setText("Please select an application.\nClick on 'Launch' to start it."); ui->launchBtn->setProperty("type", "borderless"); ui->cancelBtn->setProperty("type", "borderless"); ui->launchBtn->setStyleSheet("font-size: 9pt; padding: 10px; font-weight: bold; background: lightGrey"); ui->cancelBtn->setStyleSheet("font-size: 9pt; padding: 10px; font-weight: bold; background: lightGrey"); ui->appsList->setStyleSheet("font-size: 9pt"); + ui->definitionLabel->setStyleSheet("font-size: 9.5pt"); ui->headerLabel->setStyleSheet("font-weight: bold"); - // UI fonts - int id = QFontDatabase::addApplicationFont(":/resources/fonts/CrimsonPro-Regular.ttf"); - QString family = QFontDatabase::applicationFontFamilies(id).at(0); - QFont crimson(family); - ui->definitionLabel->setFont(QFont(crimson)); - this->adjustSize(); // Centering dialog diff --git a/src/widgets/reader/dictionarywidget.cpp b/src/widgets/reader/dictionarywidget.cpp index ca83d8a..b5cc951 100644 --- a/src/widgets/reader/dictionarywidget.cpp +++ b/src/widgets/reader/dictionarywidget.cpp @@ -14,7 +14,6 @@ dictionaryWidget::dictionaryWidget(QWidget *parent) : ui(new Ui::dictionaryWidget) { ui->setupUi(this); - ui->wordLabel->setFont(QFont("u001")); ui->wordLabel->setStyleSheet("font-weight: bold"); ui->definitionStatusLabel->setFont(QFont("u001"));