Bugfix in highlighting; emulator support in forgotten areas

This commit is contained in:
Nicolas Mailloux 2022-08-19 16:01:06 -04:00
parent ec95f7c7b9
commit 1d4605d7c9
8 changed files with 17 additions and 22 deletions

View file

@ -1125,7 +1125,7 @@ namespace {
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n") {
return 2; return 2;
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
return 2.6; return 2.6;
} }
else if(global::deviceID == "n437\n" or global::deviceID == "n873\n") { else if(global::deviceID == "n437\n" or global::deviceID == "n873\n") {

View file

@ -59,7 +59,7 @@ homePageWidget::homePageWidget(QWidget *parent) :
stdIconWidth = sW / stdIconWidthDivider; stdIconWidth = sW / stdIconWidthDivider;
stdIconHeight = sH / stdIconHeightDivider; stdIconHeight = sH / stdIconHeightDivider;
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
stdIconWidthDivider = 7; stdIconWidthDivider = 7;
stdIconHeightDivider = 7; stdIconHeightDivider = 7;
stdIconWidth = sW / stdIconWidthDivider; stdIconWidth = sW / stdIconWidthDivider;

View file

@ -57,7 +57,7 @@ localLibraryWidget::localLibraryWidget(QWidget *parent) :
stdIconWidth = sW / stdIconWidthDivider; stdIconWidth = sW / stdIconWidthDivider;
stdIconHeight = sH / stdIconHeightDivider; stdIconHeight = sH / stdIconHeightDivider;
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
stdIconWidthDivider = 8.5; stdIconWidthDivider = 8.5;
stdIconHeightDivider = 8.5; stdIconHeightDivider = 8.5;
stdIconWidth = sW / stdIconWidthDivider; stdIconWidth = sW / stdIconWidthDivider;

View file

@ -601,7 +601,7 @@ reader::reader(QWidget *parent) :
if(global::deviceID == "n705\n") { if(global::deviceID == "n705\n") {
infoLabelDefinedLength = 35; 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") { 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") {
infoLabelDefinedLength = 50; infoLabelDefinedLength = 50;
} }
else { else {
@ -630,7 +630,7 @@ reader::reader(QWidget *parent) :
if(global::deviceID == "n705\n") { if(global::deviceID == "n705\n") {
infoLabelDefinedLength = 35; 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") { 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") {
infoLabelDefinedLength = 50; infoLabelDefinedLength = 50;
} }
else { else {
@ -1401,45 +1401,39 @@ void reader::alignAndHighlightText(int alignment) {
QString modifiedPageContent; QString modifiedPageContent;
if(is_epub == true) { if(is_epub == true) {
modifiedPageContent = epubPageContent;
if(alignment == 0) { if(alignment == 0) {
modifiedPageContent = epubPageContent;
modifiedPageContent.prepend("<div align='left'>"); modifiedPageContent.prepend("<div align='left'>");
modifiedPageContent.append("</div>"); modifiedPageContent.append("</div>");
} }
if(alignment == 1) { if(alignment == 1) {
modifiedPageContent = epubPageContent;
modifiedPageContent.prepend("<div align='center'>"); modifiedPageContent.prepend("<div align='center'>");
modifiedPageContent.append("</div>"); modifiedPageContent.append("</div>");
} }
if(alignment == 2) { if(alignment == 2) {
modifiedPageContent = epubPageContent;
modifiedPageContent.prepend("<div align='right'>"); modifiedPageContent.prepend("<div align='right'>");
modifiedPageContent.append("</div>"); modifiedPageContent.append("</div>");
} }
if(alignment == 3) { if(alignment == 3) {
modifiedPageContent = epubPageContent;
modifiedPageContent.prepend("<div align='justify'>"); modifiedPageContent.prepend("<div align='justify'>");
modifiedPageContent.append("</div>"); modifiedPageContent.append("</div>");
} }
} }
else { else {
modifiedPageContent = ittext;
if(alignment == 0) { if(alignment == 0) {
modifiedPageContent = ittext;
modifiedPageContent.prepend("<div align='left'>"); modifiedPageContent.prepend("<div align='left'>");
modifiedPageContent.append("</div>"); modifiedPageContent.append("</div>");
} }
if(alignment == 1) { if(alignment == 1) {
modifiedPageContent = ittext;
modifiedPageContent.prepend("<div align='center'>"); modifiedPageContent.prepend("<div align='center'>");
modifiedPageContent.append("</div>"); modifiedPageContent.append("</div>");
} }
if(alignment == 2) { if(alignment == 2) {
modifiedPageContent = ittext;
modifiedPageContent.prepend("<div align='right'>"); modifiedPageContent.prepend("<div align='right'>");
modifiedPageContent.append("</div>"); modifiedPageContent.append("</div>");
} }
if(alignment == 3) { if(alignment == 3) {
modifiedPageContent = ittext;
modifiedPageContent.prepend("<div align='justify'>"); modifiedPageContent.prepend("<div align='justify'>");
modifiedPageContent.append("</div>"); modifiedPageContent.append("</div>");
} }
@ -1708,6 +1702,7 @@ void reader::on_sizeSlider_valueChanged(int value)
ui->sizeValueLabel->setText("5"); ui->sizeValueLabel->setText("5");
} }
} }
alignAndHighlightText(textAlignment);
} }
void reader::writeconfig_pagenumber(bool persistent) { void reader::writeconfig_pagenumber(bool persistent) {

View file

@ -45,7 +45,7 @@ koboxSettings::koboxSettings(QWidget *parent) :
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
dpiSetting = "125"; dpiSetting = "125";
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
dpiSetting = "175"; dpiSetting = "175";
} }
else if(global::deviceID == "n437\n") { else if(global::deviceID == "n437\n") {

View file

@ -186,7 +186,7 @@ settings::settings(QWidget *parent) :
ui->uiScalingSlider->setValue(2); ui->uiScalingSlider->setValue(2);
} }
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
if(dpi_number == 195) { if(dpi_number == 195) {
ui->uiScalingSlider->setValue(0); ui->uiScalingSlider->setValue(0);
} }
@ -591,7 +591,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
if(global::deviceID == "n905\n" or global::deviceID == "kt\n") { if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "160"); string_writeconfig(".config/09-dpi/config", "160");
} }
if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { 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"); string_writeconfig(".config/09-dpi/config", "195");
} }
if(global::deviceID == "n437\n") { if(global::deviceID == "n437\n") {
@ -608,7 +608,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
if(global::deviceID == "n905\n" or global::deviceID == "kt\n") { if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "187"); string_writeconfig(".config/09-dpi/config", "187");
} }
if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { 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", "210"); string_writeconfig(".config/09-dpi/config", "210");
} }
if(global::deviceID == "n437\n") { if(global::deviceID == "n437\n") {
@ -625,7 +625,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
if(global::deviceID == "n905\n" or global::deviceID == "kt\n") { if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "200"); string_writeconfig(".config/09-dpi/config", "200");
} }
if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { 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", "225"); string_writeconfig(".config/09-dpi/config", "225");
} }
if(global::deviceID == "n437\n") { if(global::deviceID == "n437\n") {
@ -743,7 +743,7 @@ void settings::on_enableUiScalingCheckBox_toggled(bool checked)
else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") { else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "160"); string_writeconfig(".config/09-dpi/config", "160");
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { 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"); string_writeconfig(".config/09-dpi/config", "195");
} }
else if(global::deviceID == "n437\n") { else if(global::deviceID == "n437\n") {

View file

@ -47,7 +47,7 @@ settingsChooser::settingsChooser(QWidget *parent) :
ui->koboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left"); ui->koboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
ui->powerSettingsBtn->setStyleSheet("padding: 20px; Text-align: left"); ui->powerSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
ui->inkboxSettingsBtn->setStyleSheet("padding: 25px; Text-align: left"); ui->inkboxSettingsBtn->setStyleSheet("padding: 25px; Text-align: left");
ui->koboxSettingsBtn->setStyleSheet("padding:25px; Text-align: left"); ui->koboxSettingsBtn->setStyleSheet("padding:25px; Text-align: left");
ui->powerSettingsBtn->setStyleSheet("padding:25px; Text-align: left"); ui->powerSettingsBtn->setStyleSheet("padding:25px; Text-align: left");

View file

@ -100,7 +100,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
dpiSetting = "125"; dpiSetting = "125";
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
dpiSetting = "175"; dpiSetting = "175";
} }
else if(global::deviceID == "n437\n") { else if(global::deviceID == "n437\n") {
@ -134,7 +134,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
dpiSetting = "175"; dpiSetting = "175";
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
dpiSetting = "225"; dpiSetting = "225";
} }
else if(global::deviceID == "n437\n") { else if(global::deviceID == "n437\n") {