From cf4fb0ff2af5b24e8aaf341ac2916333305cd330 Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Thu, 20 Jul 2023 15:11:12 -0400 Subject: [PATCH] N249: Brightness fixes --- src/functions.h | 54 +++++++++++++------ src/homeWidget/homepagewidget.cpp | 4 +- src/homeWidget/mainwindow.cpp | 6 +-- src/localLibrary/locallibrarywidget.cpp | 2 +- src/main.cpp | 8 ++- src/reader/reader.cpp | 16 +++--- src/settings/koboxsettings.cpp | 2 +- src/settings/settings.cpp | 12 ++--- src/widgets/dialogs/brightnessdialog.cpp | 53 ++++++++++-------- src/widgets/dialogs/kobox/koboxappsdialog.cpp | 4 +- src/widgets/misc/egg.cpp | 6 +-- .../virtualKeyboard/virtualkeyboard.cpp | 4 +- 12 files changed, 104 insertions(+), 67 deletions(-) diff --git a/src/functions.h b/src/functions.h index e32cd1d..8d5933b 100644 --- a/src/functions.h +++ b/src/functions.h @@ -205,6 +205,7 @@ namespace global { inline bool isN236 = false; inline bool isN437 = false; inline bool isN306 = false; + inline bool isN249 = false; inline bool isKT = false; inline bool runningInstanceIsReaderOnly; inline QString deviceID; @@ -293,11 +294,21 @@ namespace { return 0; } void setBrightness(int value) { - if(QFile::exists("/var/run/brightness")) { - std::ofstream fhandler; - fhandler.open("/var/run/brightness"); - fhandler << value; - fhandler.close(); + if(global::deviceID == "n249\n") { + if(QFile::exists("/var/run/brightness_write")) { + std::ofstream fhandler; + fhandler.open("/var/run/brightness_write"); + fhandler << value; + fhandler.close(); + } + } + else { + if(QFile::exists("/var/run/brightness")) { + std::ofstream fhandler; + fhandler.open("/var/run/brightness"); + fhandler << value; + fhandler.close(); + } } } void setBrightness_ntxio(int value) { @@ -553,7 +564,7 @@ namespace { QString getConnectionInformation() { QString getIpProg ("sh"); QStringList getIpArgs; - if(global::deviceID != "n437\n") { + if(global::deviceID != "n437\n" and global::deviceID != "n249\n") { getIpArgs << "-c" << "/sbin/ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'"; } else { @@ -624,7 +635,7 @@ namespace { defaultEpubPageHeight = 425; defaultEpubPageWidth = 425; } - else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { + else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "emu\n") { defaultEpubPageHeight = 450; defaultEpubPageWidth = 450; } @@ -657,7 +668,7 @@ namespace { defaultPdfPageWidth = 974; } } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { if(global::reader::pdfOrientation == 0) { defaultPdfPageHeight = 1398; defaultPdfPageWidth = 1022; @@ -683,7 +694,7 @@ namespace { } } void preSetBrightness(int brightnessValue) { - if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n") { + if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n") { setBrightness(brightnessValue); } else if(global::deviceID == "n613\n") { @@ -738,22 +749,33 @@ namespace { } int getWarmth() { QString sysfsWarmthPath; + int warmthValue; if(global::deviceID == "n873\n") { sysfsWarmthPath = "/sys/class/backlight/lm3630a_led/color"; } + else if(global::deviceID == "n249\n") { + sysfsWarmthPath = "/sys/class/backlight/backlight_warm/actual_brightness"; + } QString warmthConfig = readFile(sysfsWarmthPath); - int warmthValue = warmthConfig.toInt(); - warmthValue = 10 - warmthValue; + warmthValue = warmthConfig.toInt(); + if (global::deviceID == "n873\n") { + warmthValue = 10 - warmthValue; + } return warmthValue; } void setWarmth(int warmthValue) { - // Value 0 gives a warmer lighting than value 10 - warmthValue = 10 - warmthValue; - QString warmthValueStr = QString::number(warmthValue); QString sysfsWarmthPath; + QString warmthValueStr; if(global::deviceID == "n873\n") { + // Value 0 gives a warmer lighting than value 10 + warmthValue = 10 - warmthValue; + warmthValueStr = QString::number(warmthValue); sysfsWarmthPath = "/sys/class/backlight/lm3630a_led/color"; } + else if(global::deviceID == "n249\n") { + warmthValueStr = QString::number(warmthValue); + sysfsWarmthPath = "/sys/class/backlight/backlight_warm/brightness"; + } writeFile(sysfsWarmthPath, warmthValueStr); } void cinematicWarmth(int warmthValue) { @@ -1040,7 +1062,7 @@ namespace { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { return 2.6; } - else if(global::deviceID == "n437\n" or global::deviceID == "n873\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n" or global::deviceID == "n873\n") { return 3; } else { @@ -1049,7 +1071,7 @@ namespace { } global::wifi::wifiState checkWifiState() { QString interfaceName; - if(global::deviceID == "n437\n" or global::deviceID == "kt\n") { + if(global::deviceID == "n437\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n") { interfaceName = "wlan0"; } else { diff --git a/src/homeWidget/homepagewidget.cpp b/src/homeWidget/homepagewidget.cpp index 9336e71..1e60bb0 100644 --- a/src/homeWidget/homepagewidget.cpp +++ b/src/homeWidget/homepagewidget.cpp @@ -23,7 +23,7 @@ homePageWidget::homePageWidget(QWidget *parent) : stdIconWidth = sW / 25; stdIconHeight = sH / 25; } - else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { + else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "emu\n") { stdIconWidth = sW / 23.5; stdIconHeight = sH / 23.5; } @@ -65,7 +65,7 @@ homePageWidget::homePageWidget(QWidget *parent) : stdIconWidth = sW / stdIconWidthDivider; stdIconHeight = sH / stdIconHeightDivider; } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { stdIconWidthDivider = 6.5; stdIconHeightDivider = 6.5; stdIconWidth = sW / stdIconWidthDivider; diff --git a/src/homeWidget/mainwindow.cpp b/src/homeWidget/mainwindow.cpp index 4d0d723..cdd1eb3 100644 --- a/src/homeWidget/mainwindow.cpp +++ b/src/homeWidget/mainwindow.cpp @@ -91,7 +91,7 @@ MainWindow::MainWindow(QWidget *parent) wifiIconWidth = sW / 22.5; wifiIconHeight = sH / 22.5; } - else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { + else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "emu\n") { stdIconWidth = sW / 12.5; stdIconHeight = sH / 12.5; brightnessIconWidth = sW / 24.5; @@ -149,7 +149,7 @@ MainWindow::MainWindow(QWidget *parent) if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") { ui->batteryIcon->setStyleSheet("font-size: 5pt; padding-bottom: 0px; padding-top: 0px; padding-left: 1px; padding-right: 1px;"); } - else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { + else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "emu\n") { ui->batteryIcon->setStyleSheet("font-size: 5pt; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px;"); } else if(global::deviceID == "n873\n") { @@ -640,7 +640,7 @@ void MainWindow::resetIcons() { void MainWindow::setBatteryIcon() { // Battery - if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n") { + if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n") { // Hide brightness controls; they won't be very useful there anyway (for anything but the Glo (HD)/Libra/Aura 2) ... if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") { ui->brightnessBtn->hide(); diff --git a/src/localLibrary/locallibrarywidget.cpp b/src/localLibrary/locallibrarywidget.cpp index b315dd2..8c24c07 100644 --- a/src/localLibrary/locallibrarywidget.cpp +++ b/src/localLibrary/locallibrarywidget.cpp @@ -69,7 +69,7 @@ localLibraryWidget::localLibraryWidget(QWidget *parent) : stdIconWidthDivider = 8.7; stdIconHeightDivider = 8.7; } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { stdIconWidthDivider = 8.1; stdIconHeightDivider = 8.1; } diff --git a/src/main.cpp b/src/main.cpp index b5d2ad8..a123c2c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -172,6 +172,9 @@ int main(int argc, char *argv[]) else if(global::deviceID == "n306\n") { global::isN306 = true; } + else if(global::deviceID == "n249\n") { + global::isN249 = true; + } else if(global::deviceID == "kt\n") { global::isKT = true; } @@ -216,9 +219,12 @@ int main(int argc, char *argv[]) else if(global::deviceID == "n437\n") { global::isN437 = true; } - else if(global::deviceID == "n306\n") { + else if(global::deviceID == "n306\n") { global::isN306 = true; } + else if(global::deviceID == "n249\n") { + global::isN249 = true; + } else if(global::deviceID == "kt\n") { global::isKT = true; } diff --git a/src/reader/reader.cpp b/src/reader/reader.cpp index 6d9f199..73f4d7e 100644 --- a/src/reader/reader.cpp +++ b/src/reader/reader.cpp @@ -252,7 +252,7 @@ reader::reader(QWidget *parent) : ui->fontChooser->setCurrentText(global::reader::font); } // Night mode - if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n") { + if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n249\n" or global::deviceID == "n306\n") { if(checkconfig(".config/10-dark_mode/config") == true) { log("Setting night mode to ON", className); writeFile("/tmp/invertScreen", "y"); @@ -281,7 +281,7 @@ reader::reader(QWidget *parent) : ui->previousBtn->setStyleSheet("padding: 13.5px"); ui->optionsBtn->setStyleSheet("padding: 13.5px"); } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { ui->nextBtn->setStyleSheet("padding: 12.5px"); ui->previousBtn->setStyleSheet("padding: 12.5px"); ui->optionsBtn->setStyleSheet("padding: 12.5px"); @@ -343,7 +343,7 @@ reader::reader(QWidget *parent) : if(checkconfig("/opt/inkbox_genuine") == true) { float stdIconWidth; float stdIconHeight; - if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") { + if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") { stdIconWidth = sW / 16; stdIconHeight = sW / 16; } @@ -535,7 +535,7 @@ reader::reader(QWidget *parent) : if(global::deviceID == "n705\n") { infoLabelDefinedLength = 35; } - else if(global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") { + else if(global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") { infoLabelDefinedLength = 50; } else { @@ -563,7 +563,7 @@ reader::reader(QWidget *parent) : if(global::deviceID == "n705\n") { infoLabelDefinedLength = 35; } - else if(global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") { + else if(global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") { infoLabelDefinedLength = 50; } else { @@ -1122,7 +1122,7 @@ void reader::on_optionsBtn_clicked() if(global::deviceID == "n873\n") { ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 13.5px"); } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 12.5px"); } else { @@ -1130,7 +1130,7 @@ void reader::on_optionsBtn_clicked() } ui->optionsBtn->setIcon(QIcon(":/resources/settings.png")); // The Glo HD (N437) has a newer platform plugin that doesn't need this - if(global::deviceID != "n437\n") { + if(global::deviceID != "n437\n" or global::deviceID != "n306\n" or global::deviceID != "n249\n") { QTimer::singleShot(500, this, SLOT(repaint())); } menubar_shown = false; @@ -1140,7 +1140,7 @@ void reader::on_optionsBtn_clicked() if(global::deviceID == "n873\n") { ui->optionsBtn->setStyleSheet("background: black; color: white; padding: 13.5px"); } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { ui->optionsBtn->setStyleSheet("background: black; color: white; padding: 12.5px"); } else { diff --git a/src/settings/koboxsettings.cpp b/src/settings/koboxsettings.cpp index ad5f1f0..d6ec532 100644 --- a/src/settings/koboxsettings.cpp +++ b/src/settings/koboxsettings.cpp @@ -48,7 +48,7 @@ koboxSettings::koboxSettings(QWidget *parent) : else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { dpiSetting = "175"; } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { dpiSetting = "225"; } else if(global::deviceID == "n873\n") { diff --git a/src/settings/settings.cpp b/src/settings/settings.cpp index 610c1d2..c18b31f 100644 --- a/src/settings/settings.cpp +++ b/src/settings/settings.cpp @@ -106,7 +106,7 @@ settings::settings(QWidget *parent) : ui->quoteCheckBox->click(); } - if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n") { + if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n") { if(checkconfig(".config/10-dark_mode/config") == true) { ui->darkModeCheckBox->click(); } @@ -191,7 +191,7 @@ settings::settings(QWidget *parent) : else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { writeFile(".config/09-dpi/config", "195"); } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { writeFile(".config/09-dpi/config", "275"); } else if(global::deviceID == "n873\n") { @@ -248,7 +248,7 @@ settings::settings(QWidget *parent) : ui->uiScalingSlider->setValue(3); } } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { if(dpi_number == 275) { ui->uiScalingSlider->setValue(0); } @@ -672,7 +672,7 @@ void settings::on_uiScalingSlider_valueChanged(int value) if(global::deviceID == "n306\n") { writeFile(".config/09-dpi/config", "212"); } - if(global::deviceID == "n437\n") { + if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { writeFile(".config/09-dpi/config", "275"); } if(global::deviceID == "n873\n") { @@ -692,7 +692,7 @@ void settings::on_uiScalingSlider_valueChanged(int value) if(global::deviceID == "n306\n") { writeFile(".config/09-dpi/config", "227"); } - if(global::deviceID == "n437\n") { + if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { writeFile(".config/09-dpi/config", "290"); } if(global::deviceID == "n873\n") { @@ -712,7 +712,7 @@ void settings::on_uiScalingSlider_valueChanged(int value) if(global::deviceID == "n306\n") { writeFile(".config/09-dpi/config", "242"); } - if(global::deviceID == "n437\n") { + if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { writeFile(".config/09-dpi/config", "305"); } if(global::deviceID == "n873\n") { diff --git a/src/widgets/dialogs/brightnessdialog.cpp b/src/widgets/dialogs/brightnessdialog.cpp index d1e55a6..607e6df 100644 --- a/src/widgets/dialogs/brightnessdialog.cpp +++ b/src/widgets/dialogs/brightnessdialog.cpp @@ -36,7 +36,7 @@ brightnessDialog::brightnessDialog(QWidget *parent) : ui->valueLabel->setStyleSheet("font-size: 9pt"); ui->warmthValueLabel->setStyleSheet("font-size: 9pt"); - if(global::isN705 == true or global::isN905C == true or global::isN613 == true or global::isKT == true) { + if(global::isN249 == false and global::isN873 == false) { ui->warmthSlider->hide(); ui->warmthDecBtn->hide(); ui->warmthIncBtn->hide(); @@ -48,7 +48,7 @@ brightnessDialog::brightnessDialog(QWidget *parent) : ui->warmthValueLabel->deleteLater(); this->adjustSize(); } - else if (global::isN873 == true){ + else if(global::isN249 == true or global::isN873 == true) { ui->warmthDecBtn->setProperty("type", "borderless"); ui->warmthIncBtn->setProperty("type", "borderless"); ui->warmthDecBtn->setText(""); @@ -69,14 +69,31 @@ brightnessDialog::brightnessDialog(QWidget *parent) : this->adjustSize(); } - // I know, Mini and Touch don't have frontlights but that's a template to include others later... int value; int warmthValue; - if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) { + if(global::isN249 == true or global::isN873 == true) { + if(global::isN249 == true) { + ui->warmthSlider->setMaximum(100); + } + else if(global::isN873 == true) { + ui->warmthSlider->setMaximum(10); + } + } + if(global::isN249 or global::isN873 == true) { value = getBrightness(); - if(global::isN873 == true) { + if(global::isN249 == true or global::isN873 == true) { warmthValue = getWarmth(); - ui->warmthSlider->setValue(warmthValue); + if(warmthValue == 0) { + if(global::isN249 == true) { + ui->warmthValueLabel->setText("0%"); + } + else { + ui->warmthValueLabel->setText("0"); + } + } + else { + ui->warmthSlider->setValue(warmthValue); + } } } else if(global::isN613 == true) { @@ -94,17 +111,11 @@ brightnessDialog::brightnessDialog(QWidget *parent) : QString valueStr = QString::number(value); valueStr = valueStr.append("%"); ui->valueLabel->setText(valueStr); - // Warmth value label - if(global::isN873 == true) { - warmthValue = getWarmth(); - QString warmthValueStr = QString::number(warmthValue); - ui->warmthValueLabel->setText(warmthValueStr); - } // 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) { + if(global::isN249 == true or global::isN873 == true) { oldValue = getBrightness(); - if(global::isN873 == true) { + if(global::isN249 == true or global::isN873 == true) { oldWarmthValue = getWarmth(); } } @@ -126,13 +137,13 @@ void brightnessDialog::on_quitBtn_clicked() { // Reverting back to the old value brightnessDialog::preSetBrightness(oldValue); - if(global::isN873 == true) { + if(global::isN249 == true or global::isN873 == true) { setWarmth(oldWarmthValue); } // Just in case ;) brightnessWriteconfig(oldValue); - if(global::isN873 == true) { + if(global::isN249 == true or global::isN873 == true) { warmthWriteconfig(oldWarmthValue); } @@ -171,7 +182,7 @@ void brightnessDialog::on_okBtn_clicked() // Write brightness config log("Display brightness set to " + QString::number(brightnessValue), className); brightnessWriteconfig(brightnessValue); - if(global::isN873 == true) { + if(global::isN249 == true or global::isN873 == true) { warmthValue = ui->warmthSlider->value(); log("Display warmth set to " + QString::number(warmthValue), className); warmthWriteconfig(warmthValue); @@ -182,10 +193,7 @@ void brightnessDialog::on_okBtn_clicked() } void brightnessDialog::preSetBrightness(int brightnessValue) { - if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) { - setBrightness(brightnessValue); - } - else if(global::isN613 == true) { + if(global::isN613 == true) { setBrightness_ntxio(brightnessValue); } else { @@ -197,6 +205,9 @@ void brightnessDialog::on_warmthSlider_valueChanged(int value) { setWarmth(value); QString valueStr = QString::number(value); + if(global::isN249 == true) { + valueStr = valueStr + "%"; + } ui->warmthValueLabel->setText(valueStr); } diff --git a/src/widgets/dialogs/kobox/koboxappsdialog.cpp b/src/widgets/dialogs/kobox/koboxappsdialog.cpp index 96808c0..2a48009 100644 --- a/src/widgets/dialogs/kobox/koboxappsdialog.cpp +++ b/src/widgets/dialogs/kobox/koboxappsdialog.cpp @@ -96,7 +96,7 @@ void koboxAppsDialog::on_launchBtn_clicked() else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { dpiSetting = "175"; } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { dpiSetting = "225"; } else if(global::deviceID == "n873\n") { @@ -130,7 +130,7 @@ void koboxAppsDialog::on_launchBtn_clicked() else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { dpiSetting = "225"; } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { dpiSetting = "275"; } else if(global::deviceID == "n873\n") { diff --git a/src/widgets/misc/egg.cpp b/src/widgets/misc/egg.cpp index adb15c5..09684ee 100644 --- a/src/widgets/misc/egg.cpp +++ b/src/widgets/misc/egg.cpp @@ -25,7 +25,7 @@ egg::egg(QWidget *parent) : ui->nextBtn->setStyleSheet("padding: 13.5px"); ui->previousBtn->setStyleSheet("padding: 13.5px"); } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { ui->nextBtn->setStyleSheet("padding: 12.5px"); ui->previousBtn->setStyleSheet("padding: 12.5px"); } @@ -49,10 +49,8 @@ void egg::changeIndex(int index) { /* Contributors list: Szybet (0) - NiLuJe (1) - akemnade (2) Maintainer: - tux-linux (3) + tux-linux (1) */ // Contributor name diff --git a/src/widgets/virtualKeyboard/virtualkeyboard.cpp b/src/widgets/virtualKeyboard/virtualkeyboard.cpp index 70cd8c6..114df10 100644 --- a/src/widgets/virtualKeyboard/virtualkeyboard.cpp +++ b/src/widgets/virtualKeyboard/virtualkeyboard.cpp @@ -26,7 +26,7 @@ virtualkeyboard::virtualkeyboard(QWidget *parent) : if(global::deviceID == "n873\n") { padding = 27; } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { padding = 20; } ui->closeBtn->setStyleSheet("font-weight: bold; font-size: 9pt; padding: " + QString::number(padding) + "px"); @@ -136,7 +136,7 @@ virtualkeyboard::virtualkeyboard(QWidget *parent) : ui->sat->setStyleSheet("font-weight: bold; font-size: 7pt; padding: 27px"); ui->spaceBtn->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 15px; border: 1px solid black"); } - else if(global::deviceID == "n437\n") { + else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") { ui->n1->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 20px"); ui->n2->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 20px"); ui->n3->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 20px");