Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix style for status bar and preview panel #11672

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -1164,10 +1159,12 @@ void MainWindow::switchToDatabases()
{
if (m_ui->tabWidget->currentIndex() == -1) {
m_ui->stackedWidget->setCurrentIndex(WelcomeScreen);
statusBar()->hide();
statusBar()->setAutoFillBackground(false);
statusBar()->update();
} else {
m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen);
statusBar()->show();
statusBar()->setAutoFillBackground(true);
statusBar()->update();
}
}

Expand All @@ -1176,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();
}
Expand All @@ -1187,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();
Expand Down Expand Up @@ -1276,10 +1277,12 @@ void MainWindow::databaseTabChanged(int tabIndex)
{
if (tabIndex != -1 && m_ui->stackedWidget->currentIndex() == WelcomeScreen) {
m_ui->stackedWidget->setCurrentIndex(DatabaseTabScreen);
statusBar()->show();
statusBar()->setAutoFillBackground(true);
statusBar()->update();
} else if (tabIndex == -1 && m_ui->stackedWidget->currentIndex() == DatabaseTabScreen) {
m_ui->stackedWidget->setCurrentIndex(WelcomeScreen);
statusBar()->hide();
statusBar()->setAutoFillBackground(false);
statusBar()->update();
}

m_actionMultiplexer.setCurrentObject(m_ui->tabWidget->currentDatabaseWidget());
Expand Down
4 changes: 0 additions & 4 deletions src/gui/styles/base/basestyle.qss
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ QPlainTextEdit, QTextEdit {
padding-left: 4px;
}

QStatusBar {
background-color: palette(window);
}

*[title="true"] {
font-weight: bold;
}
2 changes: 1 addition & 1 deletion src/gui/styles/dark/DarkStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,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()) {
Expand Down
6 changes: 2 additions & 4 deletions src/gui/styles/dark/darkstyle.qss
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
DatabaseWidget:!active,
DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active,
EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active,
EntryPreviewWidget TagsEdit:!active, QStatusBar:!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, QStatusBar:disabled {
EntryPreviewWidget *[blendIn="true"]:disabled {
background-color: #424242;
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/styles/light/LightStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,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()) {
Expand Down
6 changes: 2 additions & 4 deletions src/gui/styles/light/lightstyle.qss
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
DatabaseWidget:!active,
DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active,
EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active,
EntryPreviewWidget TagsEdit:!active, QStatusBar:!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, QStatusBar:disabled {
EntryPreviewWidget *[blendIn="true"]:disabled {
background-color: #EDEDED;
}

Expand Down
Loading