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:
xboxones1 2025-02-23 21:32:51 +09:00 committed by Jonathan White
parent beb314d7c7
commit 3d8dac0c53
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
6 changed files with 12 additions and 19 deletions

View file

@ -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());