mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
Touch N905C initial support
This commit is contained in:
parent
d948375d03
commit
df716a2e62
3 changed files with 82 additions and 15 deletions
|
@ -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 {
|
||||
|
|
28
reader.cpp
28
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");
|
||||
|
|
62
settings.cpp
62
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
|
||||
|
|
Loading…
Reference in a new issue