localLibrary, homePageWidget, bookOptionsDialog: Various improvements and bugfixes

This commit is contained in:
Nicolas Mailloux 2022-08-01 23:14:33 -04:00
parent e92bd36a34
commit 27784ad4ec
6 changed files with 19 additions and 9 deletions

View file

@ -63,7 +63,7 @@ homePageWidget::homePageWidget(QWidget *parent) :
stdIconWidthDivider = 7; stdIconWidthDivider = 7;
stdIconHeightDivider = 7; stdIconHeightDivider = 7;
stdIconWidth = sW / stdIconWidthDivider; stdIconWidth = sW / stdIconWidthDivider;
stdIconWidth = sH / stdIconHeightDivider; stdIconHeight = sH / stdIconHeightDivider;
} }
else if(global::deviceID == "n437\n") { else if(global::deviceID == "n437\n") {
stdIconWidthDivider = 6.5; stdIconWidthDivider = 6.5;

View file

@ -61,7 +61,7 @@ localLibraryWidget::localLibraryWidget(QWidget *parent) :
stdIconWidthDivider = 8.5; stdIconWidthDivider = 8.5;
stdIconHeightDivider = 8.5; stdIconHeightDivider = 8.5;
stdIconWidth = sW / stdIconWidthDivider; stdIconWidth = sW / stdIconWidthDivider;
stdIconWidth = sH / stdIconHeightDivider; stdIconHeight = sH / stdIconHeightDivider;
} }
else if(global::deviceID == "n437\n") { else if(global::deviceID == "n437\n") {
stdIconWidthDivider = 8; stdIconWidthDivider = 8;

View file

@ -303,6 +303,11 @@ reader::reader(QWidget *parent) :
ui->previousBtn->setStyleSheet("padding: 12.5px"); ui->previousBtn->setStyleSheet("padding: 12.5px");
ui->optionsBtn->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->sizeValueLabel->setStyleSheet("font-size: 9pt; font-weight: bold");
ui->homeBtn->setStyleSheet("font-size: 9pt; padding: 5px"); ui->homeBtn->setStyleSheet("font-size: 9pt; padding: 5px");
ui->aboutBtn->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"); ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 12.5px");
} }
else { else {
ui->optionsBtn->setStyleSheet("background: white; color: black"); ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 10px");
} }
ui->optionsBtn->setIcon(QIcon(":/resources/settings.png")); ui->optionsBtn->setIcon(QIcon(":/resources/settings.png"));
// The Glo HD (N437) has a newer platform plugin that doesn't need this // 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"); ui->optionsBtn->setStyleSheet("background: black; color: white; padding: 12.5px");
} }
else { 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")); ui->optionsBtn->setIcon(QIcon(":/resources/settings-inverted.png"));
this->repaint(); this->repaint();

View file

@ -15,12 +15,12 @@ bookOptionsDialog::bookOptionsDialog(QWidget *parent) :
ui->line_2->hide(); ui->line_2->hide();
ui->deleteBtn->deleteLater(); ui->deleteBtn->deleteLater();
ui->line_2->deleteLater(); ui->line_2->deleteLater();
this->adjustSize();
} }
else { else {
ui->deleteBtn->setProperty("type", "borderless"); ui->deleteBtn->setProperty("type", "borderless");
} }
ui->infoBtn->setProperty("type", "borderless"); ui->infoBtn->setProperty("type", "borderless");
this->adjustSize();
global::localLibrary::bookOptionsDialog::bookPinAction = false; global::localLibrary::bookOptionsDialog::bookPinAction = false;
@ -124,6 +124,11 @@ void bookOptionsDialog::pinBook(int bookID) {
mainJsonObject["Book" + QString::number(i)] = jsonObject; mainJsonObject["Book" + QString::number(i)] = jsonObject;
} }
pinnedBooksObject = mainJsonObject; 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 // Writing database to file
QFile::remove(global::localLibrary::pinnedBooksDatabasePath); QFile::remove(global::localLibrary::pinnedBooksDatabasePath);

View file

@ -37,7 +37,7 @@
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">padding: 10px</string> <string notr="true">padding-left: 80px; padding-right: 80px; padding-top: 10px; padding-bottom: 10px</string>
</property> </property>
<property name="text"> <property name="text">
<string>More info</string> <string>More info</string>
@ -53,7 +53,7 @@
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">padding: 10px</string> <string notr="true">padding-left: 80px; padding-right: 80px; padding-top: 10px; padding-bottom: 10px</string>
</property> </property>
<property name="text"> <property name="text">
<string>Pin</string> <string>Pin</string>
@ -82,7 +82,7 @@
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">padding: 10px</string> <string notr="true">padding-left: 80px; padding-right: 80px; padding-top: 10px; padding-bottom: 10px</string>
</property> </property>
<property name="text"> <property name="text">
<string>Delete</string> <string>Delete</string>