Stylesheet improvements; Typo fix

This commit is contained in:
Nicolas Mailloux 2022-04-03 22:44:46 -04:00
parent 8dfc7e3251
commit 522f09df63
22 changed files with 36 additions and 36 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
inkbox.pro.user

View file

@ -61,7 +61,7 @@ apps::apps(QWidget *parent) :
ui->lightmapsLaunchBtn->deleteLater(); ui->lightmapsLaunchBtn->deleteLater();
} }
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -11,7 +11,7 @@ bookInfoDialog::bookInfoDialog(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
// Stylesheet // Stylesheet
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -15,7 +15,7 @@ brightnessDialog::brightnessDialog(QWidget *parent) :
brightnessDialog::setFont(QFont("u001")); brightnessDialog::setFont(QFont("u001"));
// Stylesheet, style & misc. // Stylesheet, style & misc.
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -10,7 +10,7 @@ calendarApp::calendarApp(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
// Stylesheet // Stylesheet
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -1,6 +1,5 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>resources/eink.qss</file>
<file>resources/checkbox-checked.png</file> <file>resources/checkbox-checked.png</file>
<file>resources/checkbox-unchecked.png</file> <file>resources/checkbox-unchecked.png</file>
<file>resources/align-center.png</file> <file>resources/align-center.png</file>

View file

@ -26,7 +26,7 @@ encryptionManager::encryptionManager(QWidget *parent) :
ui->warningDescriptionLabel->setFont(QFont("u001")); ui->warningDescriptionLabel->setFont(QFont("u001"));
// Stylesheet // Stylesheet
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -33,7 +33,7 @@ generalDialog::generalDialog(QWidget *parent) :
stylesheetFile.close(); stylesheetFile.close();
} }
else { else {
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();
@ -379,7 +379,7 @@ void generalDialog::on_okBtn_clicked()
} }
} }
else if(ui->searchComboBox->currentText() == "Online library") { else if(ui->searchComboBox->currentText() == "Online library") {
if(testPing() == 0) { if(testPing() == 0 or global::deviceID == "emu\n") {
string_writeconfig("/inkbox/searchComboBoxFunction", "Online library"); string_writeconfig("/inkbox/searchComboBoxFunction", "Online library");
if(!readFile("/external_root/opt/storage/gutenberg/last_sync").isEmpty()) { if(!readFile("/external_root/opt/storage/gutenberg/last_sync").isEmpty()) {

View file

@ -21,7 +21,7 @@ koboxAppsDialog::koboxAppsDialog(QWidget *parent) :
this->setModal(true); this->setModal(true);
// Stylesheet, style & misc. // Stylesheet, style & misc.
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -22,7 +22,7 @@ koboxSettings::koboxSettings(QWidget *parent) :
ui->okBtn->setStyleSheet("font-weight: bold"); ui->okBtn->setStyleSheet("font-weight: bold");
// Stylesheet // Stylesheet
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -178,7 +178,7 @@ int main(int argc, char *argv[])
MainWindow w; MainWindow w;
QApplication::setStyle("windows"); QApplication::setStyle("windows");
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
w.setStyleSheet(stylesheetFile.readAll()); w.setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -191,7 +191,7 @@ MainWindow::MainWindow(QWidget *parent)
} }
// Stylesheet // Stylesheet
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();
@ -419,7 +419,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->book3Btn->show(); ui->book3Btn->show();
ui->book4Btn->show(); ui->book4Btn->show();
setRecentBooksLabelsTruncateTreshold(); setRecentBooksLabelsTruncateThreshold();
// Book 1 // Book 1
string_checkconfig(".config/08-recent_books/1"); string_checkconfig(".config/08-recent_books/1");
if(checkconfig_str_val == "") { if(checkconfig_str_val == "") {
@ -427,8 +427,8 @@ MainWindow::MainWindow(QWidget *parent)
} }
else { else {
relative_path = checkconfig_str_val.split("/").last(); relative_path = checkconfig_str_val.split("/").last();
if(relative_path.length() > truncateTreshold) { if(relative_path.length() > truncateThreshold) {
relative_path.truncate(truncateTreshold); relative_path.truncate(truncateThreshold);
relative_path.append(" ..."); relative_path.append(" ...");
} }
ui->book1Btn->setText(relative_path); ui->book1Btn->setText(relative_path);
@ -441,8 +441,8 @@ MainWindow::MainWindow(QWidget *parent)
} }
else { else {
relative_path = checkconfig_str_val.split("/").last(); relative_path = checkconfig_str_val.split("/").last();
if(relative_path.length() > truncateTreshold) { if(relative_path.length() > truncateThreshold) {
relative_path.truncate(truncateTreshold); relative_path.truncate(truncateThreshold);
relative_path.append(" ..."); relative_path.append(" ...");
} }
ui->book2Btn->setText(relative_path); ui->book2Btn->setText(relative_path);
@ -455,8 +455,8 @@ MainWindow::MainWindow(QWidget *parent)
} }
else { else {
relative_path = checkconfig_str_val.split("/").last(); relative_path = checkconfig_str_val.split("/").last();
if(relative_path.length() > truncateTreshold) { if(relative_path.length() > truncateThreshold) {
relative_path.truncate(truncateTreshold); relative_path.truncate(truncateThreshold);
relative_path.append(" ..."); relative_path.append(" ...");
} }
ui->book3Btn->setText(relative_path); ui->book3Btn->setText(relative_path);
@ -469,8 +469,8 @@ MainWindow::MainWindow(QWidget *parent)
} }
else { else {
relative_path = checkconfig_str_val.split("/").last(); relative_path = checkconfig_str_val.split("/").last();
if(relative_path.length() > truncateTreshold) { if(relative_path.length() > truncateThreshold) {
relative_path.truncate(truncateTreshold); relative_path.truncate(truncateThreshold);
relative_path.append(" ..."); relative_path.append(" ...");
} }
ui->book4Btn->setText(relative_path); ui->book4Btn->setText(relative_path);
@ -1098,7 +1098,7 @@ void MainWindow::openEncfsRepackDialog() {
void MainWindow::on_libraryButton_clicked() void MainWindow::on_libraryButton_clicked()
{ {
if(testPing() == 0) { if(testPing() == 0 or global::deviceID == "emu\n") {
resetFullWindowException = false; resetFullWindowException = false;
resetWindow(false); resetWindow(false);
if(global::mainwindow::tabSwitcher::libraryWidgetSelected != true) { if(global::mainwindow::tabSwitcher::libraryWidgetSelected != true) {
@ -1134,15 +1134,15 @@ void MainWindow::resetFullWindow() {
} }
} }
void MainWindow::setRecentBooksLabelsTruncateTreshold() { void MainWindow::setRecentBooksLabelsTruncateThreshold() {
if(global::deviceID == "n705\n" or global::deviceID == "n905b\n" or global::deviceID == "n905c\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905b\n" or global::deviceID == "n905c\n") {
truncateTreshold = 12; truncateThreshold = 12;
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n"){ else if(global::deviceID == "n613\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n"){
truncateTreshold = 20; truncateThreshold = 20;
} }
else { else {
truncateTreshold = 12; truncateThreshold = 12;
} }
} }

View file

@ -43,7 +43,7 @@ public:
float wifiIconHeight; float wifiIconHeight;
float sW; float sW;
float sH; float sH;
int truncateTreshold; int truncateThreshold;
bool existing_recent_books = false; bool existing_recent_books = false;
bool reboot_after_update = false; bool reboot_after_update = false;
@ -96,7 +96,7 @@ private slots:
void on_libraryButton_clicked(); void on_libraryButton_clicked();
void resetWindow(bool resetStackedWidget); void resetWindow(bool resetStackedWidget);
void resetFullWindow(); void resetFullWindow();
void setRecentBooksLabelsTruncateTreshold(); void setRecentBooksLabelsTruncateThreshold();
void resetWifiIconClickedWhileReconnecting(); void resetWifiIconClickedWhileReconnecting();
private: private:

View file

@ -22,7 +22,7 @@ quit::quit(QWidget *parent) :
ui->backBtn->setProperty("type", "borderless"); ui->backBtn->setProperty("type", "borderless");
// Stylesheet // Stylesheet
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -124,7 +124,7 @@ reader::reader(QWidget *parent) :
QFont crimson(family); QFont crimson(family);
// Stylesheet + misc. // Stylesheet + misc.
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

View file

@ -10,7 +10,7 @@ savedwords::savedwords(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
savedwords::setFont(QFont("u001")); savedwords::setFont(QFont("u001"));
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -381,7 +381,7 @@ settings::settings(QWidget *parent) :
ui->checkOtaUpdateGridLayout->deleteLater(); ui->checkOtaUpdateGridLayout->deleteLater();
} }
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -12,7 +12,7 @@ settingsChooser::settingsChooser(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
// Stylesheet // Stylesheet
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -13,7 +13,7 @@ textwidget::textwidget(QWidget *parent) :
ui->textBrowser->setFont(QFont("u001")); ui->textBrowser->setFont(QFont("u001"));
// Stylesheet // Stylesheet
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -24,7 +24,7 @@ usbms_splash::usbms_splash(QWidget *parent) :
float stdIconHeight = sH / 1.30; float stdIconHeight = sH / 1.30;
// Stylesheet // Stylesheet
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();

View file

@ -17,7 +17,7 @@ wifiDialog::wifiDialog(QWidget *parent) :
wifiListTimer = new QTimer(this); wifiListTimer = new QTimer(this);
// Stylesheet, style & misc. // Stylesheet, style & misc.
QFile stylesheetFile(":/resources/eink.qss"); QFile stylesheetFile("eink.qss");
stylesheetFile.open(QFile::ReadOnly); stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();