diff --git a/src/settings/settings.cpp b/src/settings/settings.cpp index 2020cae..ec46185 100644 --- a/src/settings/settings.cpp +++ b/src/settings/settings.cpp @@ -90,9 +90,6 @@ settings::settings(QWidget *parent) : ui->setPasscodeLabel->hide(); ui->securityLabel->hide(); ui->line_2->hide(); - ui->uiScaleNumberLabel->hide(); - ui->uiScalingSlider->hide(); - ui->uiScalingLabel->hide(); // Variables defineDefaultPageSize(0); @@ -184,7 +181,25 @@ settings::settings(QWidget *parent) : // Scaling string_checkconfig(".config/09-dpi/config"); if(checkconfig_str_val == "") { - ; + // Writing default value depending on the device + if(global::deviceID == "n705\n") { + string_writeconfig(".config/09-dpi/config", "187"); + } + else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") { + string_writeconfig(".config/09-dpi/config", "160"); + } + else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { + string_writeconfig(".config/09-dpi/config", "195"); + } + else if(global::deviceID == "n437\n") { + string_writeconfig(".config/09-dpi/config", "275"); + } + else if(global::deviceID == "n873\n") { + string_writeconfig(".config/09-dpi/config", "285"); + } + else { + string_writeconfig(".config/09-dpi/config", "187"); + } } else { int dpi_number = checkconfig_str_val.toInt(); @@ -315,20 +330,6 @@ settings::settings(QWidget *parent) : ui->repackBtn->hide(); } - // DPI checkbox - string_checkconfig(".config/09-dpi/config"); - // Check if the string is a number; else, we don't check the check box - if(checkconfig_str_val == "false") { - string_writeconfig(".config/09-dpi/config-enabled", "false"); - } - else { - string_writeconfig(".config/09-dpi/config-enabled", "true"); - } - if(checkconfig(".config/09-dpi/config-enabled") == true) { - ui_not_user_change = true; - ui->enableUiScalingCheckBox->click(); - } - // Timezone ui->tzComboBox->addItems(QStringList(readFile(":/resources/tzlist").split("\n", Qt::SkipEmptyParts))); timezone_not_user_change = true; @@ -786,54 +787,6 @@ void settings::on_enableLockscreenCheckBox_toggled(bool checked) } } -void settings::on_enableUiScalingCheckBox_toggled(bool checked) -{ - QString settingString = "UI scaling"; - if(checked == true) { - logEnabled(settingString, className); - // Writing default value depending on the device - if(global::deviceID == "n705\n") { - string_writeconfig(".config/09-dpi/config", "187"); - } - else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") { - string_writeconfig(".config/09-dpi/config", "160"); - } - else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") { - string_writeconfig(".config/09-dpi/config", "195"); - } - else if(global::deviceID == "n437\n") { - string_writeconfig(".config/09-dpi/config", "275"); - } - else if(global::deviceID == "n873\n") { - string_writeconfig(".config/09-dpi/config", "285"); - } - else { - string_writeconfig(".config/09-dpi/config", "187"); - } - string_writeconfig(".config/09-dpi/config-enabled", "true"); - ui->uiScaleNumberLabel->show(); - ui->uiScalingSlider->show(); - ui->uiScalingLabel->show(); - launch_sh = true; - if(ui_not_user_change == true) { - ui_enable_changed = false; - } - else { - ui_enable_changed = true; - } - } - else { - logDisabled(settingString, className); - string_writeconfig(".config/09-dpi/config", "false"); - string_writeconfig(".config/09-dpi/config-enabled", "false"); - ui->uiScaleNumberLabel->hide(); - ui->uiScalingSlider->hide(); - ui->uiScalingLabel->hide(); - launch_sh = true; - ui_enable_changed = true; - } -} - void settings::on_showSystemInfoBtn_clicked() { log("'Show system info' button clicked", className); diff --git a/src/settings/settings.h b/src/settings/settings.h index 5a3478c..05762b7 100644 --- a/src/settings/settings.h +++ b/src/settings/settings.h @@ -49,7 +49,6 @@ private slots: void on_resetBtn_clicked(); void on_setPasscodeBtn_clicked(); void on_enableLockscreenCheckBox_toggled(bool checked); - void on_enableUiScalingCheckBox_toggled(bool checked); void on_showSystemInfoBtn_clicked(); void on_readerScrollBarCheckBox_toggled(bool checked); void brightnessDown(); diff --git a/src/settings/settings.ui b/src/settings/settings.ui index 40efe86..e24de5c 100644 --- a/src/settings/settings.ui +++ b/src/settings/settings.ui @@ -700,20 +700,99 @@ - - - - - 0 - 0 - + + + + QFrame::Plain - - Automatically check for updates + + Qt::Horizontal - + + + + 0 + + + + + + true + + + + Generate + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Generate system report + + + + + + + + + + Chivo + true + + + + Storage encryption + + + + + + + + Chivo + true + + + + Security + + + + + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + Enable lock screen and passcode + + + + 0 @@ -743,26 +822,23 @@ - - - - - Chivo - true - - - - Storage encryption - - - - - + + 0 + + 0 + + + + + System info + + + - + Qt::Horizontal @@ -775,27 +851,20 @@ - + true - Set - - - - - - - Set a passcode + Show - + 0 @@ -846,189 +915,6 @@ - - - - 0 - - - 0 - - - - - System info - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - true - - - - Show - - - - - - - - - 0 - - - - - Reset this device - - - - - - - - true - - - - Reset - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Enable UI scaling - - - - - - - 0 - - - - - - true - - - - Generate - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Generate system report - - - - - - - - - Enable night mode - - - - - - - QFrame::Plain - - - Qt::Horizontal - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Repack - - - - - - - - true - - - - Repack - - - - - @@ -1039,138 +925,7 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Enable - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Check for updates - - - - - - - - true - - - - Check - - - - - - - - - 0 - - - - - Update InkBox - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - true - - - - Update - - - - - - - - - - Chivo - true - - - - Security - - - - - - - QFrame::Plain - - - Qt::Horizontal - - - - - - - Enable lock screen and passcode - - - - + 0 @@ -1216,6 +971,244 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + true + + + + Set + + + + + + + Set a passcode + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Check for updates + + + + + + + + true + + + + Check + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Repack + + + + + + + + true + + + + Repack + + + + + + + + + Enable + + + + + + + Enable night mode + + + + + + + 0 + + + + + Reset this device + + + + + + + + true + + + + Reset + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + Automatically check for updates + + + + + + + 0 + + + + + Update InkBox + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + true + + + + Update + + + + +