From a27ba992eb5b4e4e9c94db51b3100dd22fcf8f8b Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Sat, 27 Mar 2021 09:39:58 -0400 Subject: [PATCH] Fixed wordsearch options button still showing bug --- reader.cpp | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/reader.cpp b/reader.cpp index b931952..90de3d6 100644 --- a/reader.cpp +++ b/reader.cpp @@ -98,22 +98,22 @@ reader::reader(QWidget *parent) : stylesheetFile.close(); ui->sizeValueLabel->setStyleSheet("font-size: 9pt"); - ui->homeBtn->setStyleSheet("font-size: 9pt"); - ui->aboutBtn->setStyleSheet("font-size: 9pt"); + ui->homeBtn->setStyleSheet("font-size: 9pt; padding: 5px"); + ui->aboutBtn->setStyleSheet("font-size: 9pt; padding: 5px"); ui->fontChooser->setStyleSheet("font-size: 9pt"); // Hiding the menubar + definition widget + brightness widget ui->hideOptionsBtn->hide(); - ui->brightnessWidget->hide(); - ui->menuBarWidget->hide(); - ui->wordWidget->hide(); + ui->brightnessWidget->setVisible(false); + ui->menuBarWidget->setVisible(false); + ui->wordWidget->setVisible(false); if(checkconfig(".config/11-menubar/sticky") == true) { - ui->spacerWidget->show(); - ui->statusBarWidget->show(); + ui->spacerWidget->setVisible(true); + ui->statusBarWidget->setVisible(true); } else { - ui->spacerWidget->hide(); - ui->statusBarWidget->hide(); + ui->spacerWidget->setVisible(false); + ui->statusBarWidget->setVisible(false); } // Getting brightness level @@ -519,15 +519,15 @@ void reader::menubar_show() { ui->hideOptionsBtn->show(); ui->optionsBtn->hide(); - ui->menuBarWidget->show(); - ui->statusBarWidget->show(); + ui->menuBarWidget->setVisible(true); + ui->statusBarWidget->setVisible(true); string_checkconfig("/opt/inkbox_device"); if(checkconfig_str_val == "n705\n") { ; } else { - ui->brightnessWidget->show(); + ui->brightnessWidget->setVisible(true); } menubar_shown = true; @@ -539,18 +539,18 @@ void reader::menubar_hide() { ; } else { - ui->brightnessWidget->hide(); + ui->brightnessWidget->setVisible(false); } ui->hideOptionsBtn->hide(); ui->optionsBtn->show(); - ui->menuBarWidget->hide(); + ui->menuBarWidget->setVisible(false); if(checkconfig(".config/11-menubar/sticky") == true) { - ui->spacerWidget->show(); - ui->statusBarWidget->show(); + ui->spacerWidget->setVisible(true); + ui->statusBarWidget->setVisible(true); } else { - ui->spacerWidget->hide(); - ui->statusBarWidget->hide(); + ui->spacerWidget->setVisible(false); + ui->statusBarWidget->setVisible(false); } menubar_shown = false; } @@ -559,16 +559,23 @@ void reader::wordwidget_show() { if(menubar_shown == true) { menubar_hide(); ui->hideOptionsBtn->hide(); - ui->wordWidget->show(); + ui->optionsBtn->hide(); + ui->line->hide(); + ui->wordWidget->setVisible(true); } else { ui->hideOptionsBtn->hide(); - ui->wordWidget->show(); + ui->optionsBtn->hide(); + ui->line->hide(); + ui->wordWidget->setVisible(true); } } void reader::wordwidget_hide() { - ui->wordWidget->hide(); + ui->wordWidget->setVisible(false); + ui->hideOptionsBtn->hide(); + ui->optionsBtn->show(); + ui->line->show(); selected_text_lock = false; }