From 27784ad4ecbe05171d0bfef20d5aa226ae15be5e Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Mon, 1 Aug 2022 23:14:33 -0400 Subject: [PATCH] localLibrary, homePageWidget, bookOptionsDialog: Various improvements and bugfixes --- src/homeWidget/homepagewidget.cpp | 2 +- src/localLibrary/locallibrarywidget.cpp | 2 +- src/main.cpp | 2 +- src/reader/reader.cpp | 9 +++++++-- src/widgets/dialogs/library/bookoptionsdialog.cpp | 7 ++++++- src/widgets/dialogs/library/bookoptionsdialog.ui | 6 +++--- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/homeWidget/homepagewidget.cpp b/src/homeWidget/homepagewidget.cpp index bde1676..97842cb 100644 --- a/src/homeWidget/homepagewidget.cpp +++ b/src/homeWidget/homepagewidget.cpp @@ -63,7 +63,7 @@ homePageWidget::homePageWidget(QWidget *parent) : stdIconWidthDivider = 7; stdIconHeightDivider = 7; stdIconWidth = sW / stdIconWidthDivider; - stdIconWidth = sH / stdIconHeightDivider; + stdIconHeight = sH / stdIconHeightDivider; } else if(global::deviceID == "n437\n") { stdIconWidthDivider = 6.5; diff --git a/src/localLibrary/locallibrarywidget.cpp b/src/localLibrary/locallibrarywidget.cpp index 43b27bf..df4e876 100644 --- a/src/localLibrary/locallibrarywidget.cpp +++ b/src/localLibrary/locallibrarywidget.cpp @@ -61,7 +61,7 @@ localLibraryWidget::localLibraryWidget(QWidget *parent) : stdIconWidthDivider = 8.5; stdIconHeightDivider = 8.5; stdIconWidth = sW / stdIconWidthDivider; - stdIconWidth = sH / stdIconHeightDivider; + stdIconHeight = sH / stdIconHeightDivider; } else if(global::deviceID == "n437\n") { stdIconWidthDivider = 8; diff --git a/src/main.cpp b/src/main.cpp index 04f07fe..6fc6653 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) global::battery::showCriticalBatteryAlert = true; alert w; - const QScreen* screen = qApp->primaryScreen(); + const QScreen * screen = qApp->primaryScreen(); w.setGeometry(QRect(QPoint(0,0), screen->geometry().size())); w.show(); return a.exec(); diff --git a/src/reader/reader.cpp b/src/reader/reader.cpp index 8dbaec9..e0c25b6 100644 --- a/src/reader/reader.cpp +++ b/src/reader/reader.cpp @@ -303,6 +303,11 @@ reader::reader(QWidget *parent) : ui->previousBtn->setStyleSheet("padding: 12.5px"); ui->optionsBtn->setStyleSheet("padding: 12.5px"); } + else { + ui->nextBtn->setStyleSheet("padding: 10px"); + ui->previousBtn->setStyleSheet("padding: 10px"); + ui->optionsBtn->setStyleSheet("padding: 10px"); + } ui->sizeValueLabel->setStyleSheet("font-size: 9pt; font-weight: bold"); ui->homeBtn->setStyleSheet("font-size: 9pt; padding: 5px"); ui->aboutBtn->setStyleSheet("font-size: 9pt; padding: 5px"); @@ -1166,7 +1171,7 @@ void reader::on_optionsBtn_clicked() ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 12.5px"); } else { - ui->optionsBtn->setStyleSheet("background: white; color: black"); + ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 10px"); } ui->optionsBtn->setIcon(QIcon(":/resources/settings.png")); // The Glo HD (N437) has a newer platform plugin that doesn't need this @@ -1184,7 +1189,7 @@ void reader::on_optionsBtn_clicked() ui->optionsBtn->setStyleSheet("background: black; color: white; padding: 12.5px"); } else { - ui->optionsBtn->setStyleSheet("background: black; color: white"); + ui->optionsBtn->setStyleSheet("background: black; color: white; padding: 10px"); } ui->optionsBtn->setIcon(QIcon(":/resources/settings-inverted.png")); this->repaint(); diff --git a/src/widgets/dialogs/library/bookoptionsdialog.cpp b/src/widgets/dialogs/library/bookoptionsdialog.cpp index e514301..4eaff9d 100644 --- a/src/widgets/dialogs/library/bookoptionsdialog.cpp +++ b/src/widgets/dialogs/library/bookoptionsdialog.cpp @@ -15,12 +15,12 @@ bookOptionsDialog::bookOptionsDialog(QWidget *parent) : ui->line_2->hide(); ui->deleteBtn->deleteLater(); ui->line_2->deleteLater(); - this->adjustSize(); } else { ui->deleteBtn->setProperty("type", "borderless"); } ui->infoBtn->setProperty("type", "borderless"); + this->adjustSize(); global::localLibrary::bookOptionsDialog::bookPinAction = false; @@ -124,6 +124,11 @@ void bookOptionsDialog::pinBook(int bookID) { mainJsonObject["Book" + QString::number(i)] = jsonObject; } pinnedBooksObject = mainJsonObject; + + QString function = __func__; log(function + ": Pinned book with ID " + QString::number(global::localLibrary::bookOptionsDialog::bookID), className); + global::toast::delay = 3000; + emit showToast("Book pinned successfully"); + global::localLibrary::bookOptionsDialog::bookPinAction = true; } // Writing database to file QFile::remove(global::localLibrary::pinnedBooksDatabasePath); diff --git a/src/widgets/dialogs/library/bookoptionsdialog.ui b/src/widgets/dialogs/library/bookoptionsdialog.ui index 96c3a56..c3a053d 100644 --- a/src/widgets/dialogs/library/bookoptionsdialog.ui +++ b/src/widgets/dialogs/library/bookoptionsdialog.ui @@ -37,7 +37,7 @@ - padding: 10px + padding-left: 80px; padding-right: 80px; padding-top: 10px; padding-bottom: 10px More info @@ -53,7 +53,7 @@ - padding: 10px + padding-left: 80px; padding-right: 80px; padding-top: 10px; padding-bottom: 10px Pin @@ -82,7 +82,7 @@ - padding: 10px + padding-left: 80px; padding-right: 80px; padding-top: 10px; padding-bottom: 10px Delete