mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-05 01:15:33 -05:00
Minor theme fixes
* Support mouse hover color change for QPushButtons. * Fix #5040 - don't enforce standard palette when in classic theme mode
This commit is contained in:
parent
004f5d407f
commit
a88fe61a7b
@ -144,18 +144,19 @@ Application::~Application()
|
|||||||
|
|
||||||
void Application::applyTheme()
|
void Application::applyTheme()
|
||||||
{
|
{
|
||||||
QString appTheme = config()->get(Config::GUI_ApplicationTheme).toString();
|
auto appTheme = config()->get(Config::GUI_ApplicationTheme).toString();
|
||||||
if (appTheme == "auto") {
|
if (appTheme == "auto") {
|
||||||
if (osUtils->isDarkMode()) {
|
appTheme = osUtils->isDarkMode() ? "dark" : "light";
|
||||||
setStyle(new DarkStyle);
|
|
||||||
m_darkTheme = true;
|
|
||||||
} else {
|
|
||||||
setStyle(new LightStyle);
|
|
||||||
}
|
}
|
||||||
} else if (appTheme == "light") {
|
|
||||||
|
if (appTheme == "light") {
|
||||||
setStyle(new LightStyle);
|
setStyle(new LightStyle);
|
||||||
|
// Workaround Qt 5.15+ bug
|
||||||
|
setPalette(style()->standardPalette());
|
||||||
} else if (appTheme == "dark") {
|
} else if (appTheme == "dark") {
|
||||||
setStyle(new DarkStyle);
|
setStyle(new DarkStyle);
|
||||||
|
// Workaround Qt 5.15+ bug
|
||||||
|
setPalette(style()->standardPalette());
|
||||||
m_darkTheme = true;
|
m_darkTheme = true;
|
||||||
} else {
|
} else {
|
||||||
// Classic mode, don't check for dark theme on Windows
|
// Classic mode, don't check for dark theme on Windows
|
||||||
@ -164,8 +165,6 @@ void Application::applyTheme()
|
|||||||
m_darkTheme = osUtils->isDarkMode();
|
m_darkTheme = osUtils->isDarkMode();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
setPalette(style()->standardPalette());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Application::event(QEvent* event)
|
bool Application::event(QEvent* event)
|
||||||
|
@ -3,6 +3,11 @@ QPushButton:default {
|
|||||||
color: palette(highlighted-text);
|
color: palette(highlighted-text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Note: default button hover is defined in the respective theme style */
|
||||||
|
QPushButton:!default:hover {
|
||||||
|
background: palette(mid);
|
||||||
|
}
|
||||||
|
|
||||||
QSpinBox {
|
QSpinBox {
|
||||||
min-width: 90px;
|
min-width: 90px;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,16 @@ EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled {
|
|||||||
background-color: #424242;
|
background-color: #424242;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPushButton:!default:hover {
|
||||||
|
/* Using slightly darker shade from palette(button) */
|
||||||
|
background: #252528;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:default:hover {
|
||||||
|
/* Using slightly lighter shade from palette(highlight) */
|
||||||
|
background: #2E582E;
|
||||||
|
}
|
||||||
|
|
||||||
QToolTip {
|
QToolTip {
|
||||||
color: #BFBFBF;
|
color: #BFBFBF;
|
||||||
background-color: #2D532D;
|
background-color: #2D532D;
|
||||||
|
@ -8,11 +8,16 @@ EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled {
|
|||||||
background-color: #EDEDED;
|
background-color: #EDEDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
QGroupBox::title {
|
QPushButton:default:hover {
|
||||||
color: #4B7B19;
|
/* Using slightly lighter shade from palette(highlight) */
|
||||||
|
background: #568821;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolTip {
|
QToolTip {
|
||||||
color: #F9F9F9;
|
color: #F9F9F9;
|
||||||
background-color: #4D7F1A;
|
background-color: #4D7F1A;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QGroupBox::title {
|
||||||
|
color: #4B7B19;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user