Skip to content

Commit 2a3d77e

Browse files
committed
styles: temporal fix for dark_blue style and colors have gotten directly from palette
1 parent 07f72d0 commit 2a3d77e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/MainWindow.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ MainWindow::MainWindow()
273273

274274
setDockNestingEnabled(true);
275275

276+
m_systemPalette = QApplication::palette();
277+
276278
QString stylesheetFilePath = settings.value("settings/stylesheet", "").toString();
277279
if (!stylesheetFilePath.isEmpty())
278280
stylesheetChanged(stylesheetFilePath);
@@ -1673,6 +1675,23 @@ MainWindow::stylesheetChanged(const QString stylesheetFilePath)
16731675

16741676
stylesheet.replace("@path_to_pics@", STYLESHEETS_DIR);
16751677

1678+
if (stylesheet.isEmpty())
1679+
{
1680+
QApplication::setPalette(m_systemPalette);
1681+
}
1682+
else
1683+
{
1684+
QPalette palette = QPalette(m_systemPalette);
1685+
1686+
// TODO: Replace me with something normal
1687+
if (stylesheetFilePath.endsWith("dark_blue.qss"))
1688+
{
1689+
palette.setColor(QPalette::Highlight, QColor(0x40, 0xA0, 0xF0));
1690+
}
1691+
1692+
QApplication::setPalette(palette);
1693+
}
1694+
16761695
setStyleSheet(stylesheet);
16771696
}
16781697

src/MainWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ private slots:
338338
bool m_debug;
339339
bool m_closing;
340340
bool m_beepOnBatchProcessingCompletion;
341+
QPalette m_systemPalette;
341342
};
342343

343344
#endif

0 commit comments

Comments
 (0)