mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-03-13 01:26:37 -04:00
Dynamically change the status bar color depending on the current screen (#11672)
* Revert (https://github.com/keepassxreboot/keepassxc/pull/11455) * Do not use styles for QStatusBar * Dynamically change the status bar color depending on the current screen
This commit is contained in:
parent
beb314d7c7
commit
3d8dac0c53
@ -726,11 +726,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()
|
||||
@ -1235,10 +1230,10 @@ void MainWindow::switchToDatabases()
|
||||
{
|
||||
if (m_ui->tabWidget->currentIndex() == -1) {
|
||||
m_ui->stackedWidget->setCurrentIndex(WelcomeScreen);
|
||||
statusBar()->hide();
|
||||
statusBar()->setAutoFillBackground(false);
|
||||
} else {
|
||||
m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen);
|
||||
statusBar()->show();
|
||||
statusBar()->setAutoFillBackground(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1247,6 +1242,7 @@ void MainWindow::switchToSettings(bool enabled)
|
||||
if (enabled) {
|
||||
m_ui->settingsWidget->loadSettings();
|
||||
m_ui->stackedWidget->setCurrentIndex(SettingsScreen);
|
||||
statusBar()->setAutoFillBackground(true);
|
||||
} else {
|
||||
switchToDatabases();
|
||||
}
|
||||
@ -1258,6 +1254,7 @@ void MainWindow::togglePasswordGenerator(bool enabled)
|
||||
m_ui->passwordGeneratorWidget->loadSettings();
|
||||
m_ui->passwordGeneratorWidget->regeneratePassword();
|
||||
m_ui->stackedWidget->setCurrentIndex(PasswordGeneratorScreen);
|
||||
statusBar()->setAutoFillBackground(false);
|
||||
} else {
|
||||
m_ui->passwordGeneratorWidget->saveSettings();
|
||||
switchToDatabases();
|
||||
@ -1326,10 +1323,10 @@ void MainWindow::databaseTabChanged(int tabIndex)
|
||||
{
|
||||
if (tabIndex != -1 && m_ui->stackedWidget->currentIndex() == WelcomeScreen) {
|
||||
m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen);
|
||||
statusBar()->show();
|
||||
statusBar()->setAutoFillBackground(true);
|
||||
} else if (tabIndex == -1 && m_ui->stackedWidget->currentIndex() == DatabaseTabScreen) {
|
||||
m_ui->stackedWidget->setCurrentIndex(WelcomeScreen);
|
||||
statusBar()->hide();
|
||||
statusBar()->setAutoFillBackground(false);
|
||||
}
|
||||
|
||||
m_actionMultiplexer.setCurrentObject(m_ui->tabWidget->currentDatabaseWidget());
|
||||
|
@ -72,10 +72,6 @@ QPlainTextEdit, QTextEdit {
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
QStatusBar {
|
||||
background-color: palette(window);
|
||||
}
|
||||
|
||||
*[title="true"] {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ QString DarkStyle::getAppStyleSheet() const
|
||||
void DarkStyle::polish(QWidget* widget)
|
||||
{
|
||||
if (qobject_cast<QMainWindow*>(widget) || qobject_cast<QDialog*>(widget) || qobject_cast<QMenuBar*>(widget)
|
||||
|| qobject_cast<QToolBar*>(widget) || qobject_cast<QStatusBar*>(widget)) {
|
||||
|| qobject_cast<QToolBar*>(widget)) {
|
||||
auto palette = widget->palette();
|
||||
#if defined(Q_OS_MACOS)
|
||||
if (!osUtils->isDarkMode()) {
|
||||
|
@ -1,12 +1,12 @@
|
||||
DatabaseWidget:!active,
|
||||
DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active,
|
||||
EntryPreviewWidget *:!active[blendIn="true"], QStatusBar:!active {
|
||||
EntryPreviewWidget *:!active[blendIn="true"] {
|
||||
background-color: #404042;
|
||||
}
|
||||
|
||||
DatabaseWidget:disabled,
|
||||
DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled,
|
||||
EntryPreviewWidget *:disabled[blendIn="true"], QStatusBar:disabled {
|
||||
EntryPreviewWidget *:disabled[blendIn="true"] {
|
||||
background-color: #424242;
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ QString LightStyle::getAppStyleSheet() const
|
||||
void LightStyle::polish(QWidget* widget)
|
||||
{
|
||||
if (qobject_cast<QMainWindow*>(widget) || qobject_cast<QDialog*>(widget) || qobject_cast<QMenuBar*>(widget)
|
||||
|| qobject_cast<QToolBar*>(widget) || qobject_cast<QStatusBar*>(widget)) {
|
||||
|| qobject_cast<QToolBar*>(widget)) {
|
||||
auto palette = widget->palette();
|
||||
#if defined(Q_OS_MACOS)
|
||||
if (osUtils->isDarkMode()) {
|
||||
|
@ -1,12 +1,12 @@
|
||||
DatabaseWidget:!active,
|
||||
DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active,
|
||||
EntryPreviewWidget *:!active[blendIn="true"], QStatusBar:!active {
|
||||
EntryPreviewWidget *:!active[blendIn="true"] {
|
||||
background-color: #FCFCFC;
|
||||
}
|
||||
|
||||
DatabaseWidget:disabled,
|
||||
DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled,
|
||||
EntryPreviewWidget *:disabled[blendIn="true"], QStatusBar:disabled {
|
||||
EntryPreviewWidget *:disabled[blendIn="true"] {
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user