From f5dd3c3767305482595576fbc8adf08808b7c031 Mon Sep 17 00:00:00 2001 From: xboxones1 <91512529+xboxones1@users.noreply.github.com> Date: Sat, 18 Jan 2025 02:06:23 +0000 Subject: [PATCH 1/4] Revert (https://github.com/keepassxreboot/keepassxc/pull/11455) --- src/gui/MainWindow.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 3a19f06683..6913a33a2e 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -683,11 +683,6 @@ MainWindow::MainWindow() restoreConfigState(); updateMenuActionState(); - - // Check the current screen and hide the status bar if it is the WelcomeScreen - if (m_ui->stackedWidget->currentIndex() == WelcomeScreen) { - statusBar()->hide(); - } } MainWindow::~MainWindow() @@ -1164,10 +1159,8 @@ void MainWindow::switchToDatabases() { if (m_ui->tabWidget->currentIndex() == -1) { m_ui->stackedWidget->setCurrentIndex(WelcomeScreen); - statusBar()->hide(); } else { m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen); - statusBar()->show(); } } @@ -1276,10 +1269,8 @@ void MainWindow::databaseTabChanged(int tabIndex) { if (tabIndex != -1 && m_ui->stackedWidget->currentIndex() == WelcomeScreen) { m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen); - statusBar()->show(); } else if (tabIndex == -1 && m_ui->stackedWidget->currentIndex() == DatabaseTabScreen) { m_ui->stackedWidget->setCurrentIndex(WelcomeScreen); - statusBar()->hide(); } m_actionMultiplexer.setCurrentObject(m_ui->tabWidget->currentDatabaseWidget()); From e4dd112817310e35d1c082c67b657a5a7fd38ece Mon Sep 17 00:00:00 2001 From: xboxones1 <91512529+xboxones1@users.noreply.github.com> Date: Sat, 18 Jan 2025 02:19:11 +0000 Subject: [PATCH 2/4] Do not use styles for QStatusBar --- src/gui/styles/base/basestyle.qss | 4 ---- src/gui/styles/dark/DarkStyle.cpp | 2 +- src/gui/styles/dark/darkstyle.qss | 4 ++-- src/gui/styles/light/LightStyle.cpp | 2 +- src/gui/styles/light/lightstyle.qss | 4 ++-- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/gui/styles/base/basestyle.qss b/src/gui/styles/base/basestyle.qss index 34cc283dd2..d5211e90ab 100644 --- a/src/gui/styles/base/basestyle.qss +++ b/src/gui/styles/base/basestyle.qss @@ -72,10 +72,6 @@ QPlainTextEdit, QTextEdit { padding-left: 4px; } -QStatusBar { - background-color: palette(window); -} - *[title="true"] { font-weight: bold; } diff --git a/src/gui/styles/dark/DarkStyle.cpp b/src/gui/styles/dark/DarkStyle.cpp index 5b021b19ad..daf16aaaca 100644 --- a/src/gui/styles/dark/DarkStyle.cpp +++ b/src/gui/styles/dark/DarkStyle.cpp @@ -113,7 +113,7 @@ QString DarkStyle::getAppStyleSheet() const void DarkStyle::polish(QWidget* widget) { if (qobject_cast(widget) || qobject_cast(widget) || qobject_cast(widget) - || qobject_cast(widget) || qobject_cast(widget)) { + || qobject_cast(widget)) { auto palette = widget->palette(); #if defined(Q_OS_MACOS) if (!osUtils->isDarkMode()) { diff --git a/src/gui/styles/dark/darkstyle.qss b/src/gui/styles/dark/darkstyle.qss index 2b0cfebc09..1f206b6ee7 100644 --- a/src/gui/styles/dark/darkstyle.qss +++ b/src/gui/styles/dark/darkstyle.qss @@ -1,14 +1,14 @@ DatabaseWidget:!active, DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active, EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active, -EntryPreviewWidget TagsEdit:!active, QStatusBar:!active { +EntryPreviewWidget TagsEdit:!active { background-color: #404042; } DatabaseWidget:disabled, DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled, EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled, -EntryPreviewWidget TagsEdit:disabled, QStatusBar:disabled { +EntryPreviewWidget TagsEdit:disabled { background-color: #424242; } diff --git a/src/gui/styles/light/LightStyle.cpp b/src/gui/styles/light/LightStyle.cpp index d20b1ef362..f739954129 100644 --- a/src/gui/styles/light/LightStyle.cpp +++ b/src/gui/styles/light/LightStyle.cpp @@ -113,7 +113,7 @@ QString LightStyle::getAppStyleSheet() const void LightStyle::polish(QWidget* widget) { if (qobject_cast(widget) || qobject_cast(widget) || qobject_cast(widget) - || qobject_cast(widget) || qobject_cast(widget)) { + || qobject_cast(widget)) { auto palette = widget->palette(); #if defined(Q_OS_MACOS) if (osUtils->isDarkMode()) { diff --git a/src/gui/styles/light/lightstyle.qss b/src/gui/styles/light/lightstyle.qss index a2b6d77699..36ad09cc85 100644 --- a/src/gui/styles/light/lightstyle.qss +++ b/src/gui/styles/light/lightstyle.qss @@ -1,14 +1,14 @@ DatabaseWidget:!active, DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active, EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active, -EntryPreviewWidget TagsEdit:!active, QStatusBar:!active { +EntryPreviewWidget TagsEdit:!active { background-color: #FCFCFC; } DatabaseWidget:disabled, DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled, EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled, -EntryPreviewWidget TagsEdit:disabled, QStatusBar:disabled { +EntryPreviewWidget TagsEdit:disabled { background-color: #EDEDED; } From 8dd78d5ee44b40fec2c3e0a2146e8efd7f135d4a Mon Sep 17 00:00:00 2001 From: xboxones1 <91512529+xboxones1@users.noreply.github.com> Date: Mon, 20 Jan 2025 01:06:35 +0000 Subject: [PATCH 3/4] Dynamically change the status bar color depending on the current screen --- src/gui/MainWindow.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 6913a33a2e..f79fdbe645 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -1159,8 +1159,12 @@ void MainWindow::switchToDatabases() { if (m_ui->tabWidget->currentIndex() == -1) { m_ui->stackedWidget->setCurrentIndex(WelcomeScreen); + statusBar()->setAutoFillBackground(false); + statusBar()->update(); } else { m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen); + statusBar()->setAutoFillBackground(true); + statusBar()->update(); } } @@ -1169,6 +1173,8 @@ void MainWindow::switchToSettings(bool enabled) if (enabled) { m_ui->settingsWidget->loadSettings(); m_ui->stackedWidget->setCurrentIndex(SettingsScreen); + statusBar()->setAutoFillBackground(true); + statusBar()->update(); } else { switchToDatabases(); } @@ -1180,6 +1186,8 @@ void MainWindow::togglePasswordGenerator(bool enabled) m_ui->passwordGeneratorWidget->loadSettings(); m_ui->passwordGeneratorWidget->regeneratePassword(); m_ui->stackedWidget->setCurrentIndex(PasswordGeneratorScreen); + statusBar()->setAutoFillBackground(false); + statusBar()->update(); } else { m_ui->passwordGeneratorWidget->saveSettings(); switchToDatabases(); @@ -1269,8 +1277,12 @@ void MainWindow::databaseTabChanged(int tabIndex) { if (tabIndex != -1 && m_ui->stackedWidget->currentIndex() == WelcomeScreen) { m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen); + statusBar()->setAutoFillBackground(true); + statusBar()->update(); } else if (tabIndex == -1 && m_ui->stackedWidget->currentIndex() == DatabaseTabScreen) { m_ui->stackedWidget->setCurrentIndex(WelcomeScreen); + statusBar()->setAutoFillBackground(false); + statusBar()->update(); } m_actionMultiplexer.setCurrentObject(m_ui->tabWidget->currentDatabaseWidget()); From 302bbc821b102a1306557e5d75c9f716fa791bb2 Mon Sep 17 00:00:00 2001 From: xboxones1 <91512529+xboxones1@users.noreply.github.com> Date: Sat, 18 Jan 2025 08:13:22 +0000 Subject: [PATCH 4/4] Fix style for the preview panel --- src/gui/styles/dark/darkstyle.qss | 6 ++---- src/gui/styles/light/lightstyle.qss | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/gui/styles/dark/darkstyle.qss b/src/gui/styles/dark/darkstyle.qss index 1f206b6ee7..15ef62213b 100644 --- a/src/gui/styles/dark/darkstyle.qss +++ b/src/gui/styles/dark/darkstyle.qss @@ -1,14 +1,12 @@ DatabaseWidget:!active, DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active, -EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active, -EntryPreviewWidget TagsEdit:!active { +EntryPreviewWidget *[blendIn="true"]:!active { background-color: #404042; } DatabaseWidget:disabled, DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled, -EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled, -EntryPreviewWidget TagsEdit:disabled { +EntryPreviewWidget *[blendIn="true"]:disabled { background-color: #424242; } diff --git a/src/gui/styles/light/lightstyle.qss b/src/gui/styles/light/lightstyle.qss index 36ad09cc85..09f9b314d1 100644 --- a/src/gui/styles/light/lightstyle.qss +++ b/src/gui/styles/light/lightstyle.qss @@ -1,14 +1,12 @@ DatabaseWidget:!active, DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active, -EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active, -EntryPreviewWidget TagsEdit:!active { +EntryPreviewWidget *[blendIn="true"]:!active { background-color: #FCFCFC; } DatabaseWidget:disabled, DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled, -EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled, -EntryPreviewWidget TagsEdit:disabled { +EntryPreviewWidget *[blendIn="true"]:disabled { background-color: #EDEDED; }