Skip to content

Commit 171d632

Browse files
committed
Dynamically change the status bar color depending on the current screen
1 parent eef293a commit 171d632

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gui/MainWindow.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,10 @@ void MainWindow::switchToDatabases()
11651165
{
11661166
if (m_ui->tabWidget->currentIndex() == -1) {
11671167
m_ui->stackedWidget->setCurrentIndex(WelcomeScreen);
1168+
statusBar()->setAutoFillBackground(false);
11681169
} else {
11691170
m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen);
1171+
statusBar()->setAutoFillBackground(true);
11701172
}
11711173
}
11721174

@@ -1175,6 +1177,7 @@ void MainWindow::switchToSettings(bool enabled)
11751177
if (enabled) {
11761178
m_ui->settingsWidget->loadSettings();
11771179
m_ui->stackedWidget->setCurrentIndex(SettingsScreen);
1180+
statusBar()->setAutoFillBackground(true);
11781181
} else {
11791182
switchToDatabases();
11801183
}
@@ -1186,6 +1189,7 @@ void MainWindow::togglePasswordGenerator(bool enabled)
11861189
m_ui->passwordGeneratorWidget->loadSettings();
11871190
m_ui->passwordGeneratorWidget->regeneratePassword();
11881191
m_ui->stackedWidget->setCurrentIndex(PasswordGeneratorScreen);
1192+
statusBar()->setAutoFillBackground(false);
11891193
} else {
11901194
m_ui->passwordGeneratorWidget->saveSettings();
11911195
switchToDatabases();
@@ -1275,8 +1279,10 @@ void MainWindow::databaseTabChanged(int tabIndex)
12751279
{
12761280
if (tabIndex != -1 && m_ui->stackedWidget->currentIndex() == WelcomeScreen) {
12771281
m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen);
1282+
statusBar()->setAutoFillBackground(true);
12781283
} else if (tabIndex == -1 && m_ui->stackedWidget->currentIndex() == DatabaseTabScreen) {
12791284
m_ui->stackedWidget->setCurrentIndex(WelcomeScreen);
1285+
statusBar()->setAutoFillBackground(false);
12801286
}
12811287

12821288
m_actionMultiplexer.setCurrentObject(m_ui->tabWidget->currentDatabaseWidget());

0 commit comments

Comments
 (0)