diff --git a/mainwindow.cpp b/mainwindow.cpp index 7171ab2..168887c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -83,7 +83,7 @@ MainWindow::MainWindow(QWidget *parent) // Battery string_checkconfig_ro("/opt/inkbox_device"); - if(checkconfig_str_val == "n705\n") { + if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") { // Hide brightness controls; they won't be very useful there anyway... ui->brightnessBtn->hide(); ui->line_7->hide(); @@ -119,6 +119,7 @@ MainWindow::MainWindow(QWidget *parent) } } else { + // Setting icons up stdIconWidth = sW / 19; stdIconHeight = sH / 19; QPixmap chargingPixmap(":/resources/battery_charging.png"); @@ -164,9 +165,9 @@ MainWindow::MainWindow(QWidget *parent) ui->brightnessBtn->setStyleSheet("font-size: 9pt; padding-bottom: 5px; padding-top: 5px; padding-left: 8px; padding-right: 8px;"); - // Checking if we have a Mini there + // Checking if we have a Mini or Touch there string_checkconfig_ro("/opt/inkbox_device"); - if(checkconfig_str_val == "n705\n") { + if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") { ui->batteryIcon->setStyleSheet("font-size: 5pt; padding-bottom: 0px; padding-top: 0px; padding-left: 1px; padding-right: 1px;"); } else { diff --git a/reader.cpp b/reader.cpp index 150b9ee..465f1d1 100644 --- a/reader.cpp +++ b/reader.cpp @@ -145,7 +145,7 @@ reader::reader(QWidget *parent) : // Defining what the icons' size will be if(checkconfig("/opt/inkbox_genuine") == true) { string_checkconfig_ro("/opt/inkbox_device"); - if(checkconfig_str_val == "n705\n") { + if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") { float stdIconWidth = sW / 16; float stdIconHeight = sW / 16; QPixmap chargingPixmap(":/resources/battery_charging.png"); @@ -657,7 +657,7 @@ void reader::menubar_show() { ui->statusBarWidget->setVisible(true); string_checkconfig("/opt/inkbox_device"); - if(checkconfig_str_val == "n705\n") { + if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") { ; } else { @@ -676,7 +676,7 @@ void reader::menubar_show() { void reader::menubar_hide() { string_checkconfig("/opt/inkbox_device"); - if(checkconfig_str_val == "n705\n") { + if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") { ui->brightnessWidget->setVisible(false); } else { @@ -805,6 +805,28 @@ void reader::on_sizeSlider_valueChanged(int value) ui->sizeValueLabel->setText("5"); } } + if(checkconfig_match("/opt/inkbox_device", "n905\n") == true) { + if(value == 0) { + ui->text->setStyleSheet("font-size: 6pt"); + ui->sizeValueLabel->setText("1"); + } + if(value == 1) { + ui->text->setStyleSheet("font-size: 10pt"); + ui->sizeValueLabel->setText("2"); + } + if(value == 2) { + ui->text->setStyleSheet("font-size: 14pt"); + ui->sizeValueLabel->setText("3"); + } + if(value == 3) { + ui->text->setStyleSheet("font-size: 18pt"); + ui->sizeValueLabel->setText("4"); + } + if(value == 4) { + ui->text->setStyleSheet("font-size: 22pt"); + ui->sizeValueLabel->setText("5"); + } + } else { if(value == 0) { ui->text->setStyleSheet("font-size: 6pt"); diff --git a/settings.cpp b/settings.cpp index ee7a59a..4ef0b4c 100644 --- a/settings.cpp +++ b/settings.cpp @@ -99,14 +99,40 @@ settings::settings(QWidget *parent) : } else { int dpi_number = checkconfig_str_val.toInt(); - if(dpi_number == 187) { - ui->uiScalingSlider->setValue(0); + // Checking if it's a Mini or a Touch + string_checkconfig("/opt/inkbox_device"); + if(checkconfig_str_val == "n705\n") { + if(dpi_number == 187) { + ui->uiScalingSlider->setValue(0); + } + if(dpi_number == 214) { + ui->uiScalingSlider->setValue(1); + } + if(dpi_number == 227) { + ui->uiScalingSlider->setValue(2); + } } - if(dpi_number == 214) { - ui->uiScalingSlider->setValue(1); + if(checkconfig_str_val == "n905\n") { + if(dpi_number == 160) { + ui->uiScalingSlider->setValue(0); + } + if(dpi_number == 187) { + ui->uiScalingSlider->setValue(1); + } + if(dpi_number == 200) { + ui->uiScalingSlider->setValue(2); + } } - if(dpi_number == 227) { - ui->uiScalingSlider->setValue(2); + else { + if(dpi_number == 187) { + ui->uiScalingSlider->setValue(0); + } + if(dpi_number == 214) { + ui->uiScalingSlider->setValue(1); + } + if(dpi_number == 227) { + ui->uiScalingSlider->setValue(2); + } } } @@ -470,13 +496,31 @@ void settings::on_darkModeCheckBox_toggled(bool checked) void settings::on_uiScalingSlider_valueChanged(int value) { if(value == 0) { - string_writeconfig(".config/09-dpi/config", "187"); + string_checkconfig("/opt/inkbox_device"); + if(checkconfig_str_val == "n705\n") { + string_writeconfig(".config/09-dpi/config", "187"); + } + if(checkconfig_str_val == "n905\n") { + string_writeconfig(".config/09-dpi/config", "160"); + } } if(value == 1) { - string_writeconfig(".config/09-dpi/config", "214"); + string_checkconfig("/opt/inkbox_device"); + if(checkconfig_str_val == "n705\n") { + string_writeconfig(".config/09-dpi/config", "214"); + } + if(checkconfig_str_val == "n905\n") { + string_writeconfig(".config/09-dpi/config", "187"); + } } if(value == 2) { - string_writeconfig(".config/09-dpi/config", "227"); + string_checkconfig("/opt/inkbox_device"); + if(checkconfig_str_val == "n705\n") { + string_writeconfig(".config/09-dpi/config", "227"); + } + if(checkconfig_str_val == "n905\n") { + string_writeconfig(".config/09-dpi/config", "200"); + } } // Making sense for the user