From 05df68b1331dbfdf9aff98139a9a1f96f147e651 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Sat, 2 Jan 2021 12:20:34 +1100 Subject: Fix bug with fancy url bar styling We are now also using a custom colour for it in the default light/dark themes, just because we can get a little more control over how it looks. The OS Default theme uses the 'mid' colour from palette --- src/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 2b5e635..ce64040 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -428,12 +428,17 @@ void kristall::saveSettings() void kristall::setTheme(Theme theme) { assert(app != nullptr); + if(theme == Theme::os_default) { app->setStyleSheet(""); QIcon::setThemeName(""); + + // Use "mid" colour for our URL bar dim colour: + kristall::options.fancy_urlbar_dim_colour + = app->palette().color(QPalette::Mid); } - if(theme == Theme::light) + else if(theme == Theme::light) { QFile file(":/light.qss"); file.open(QFile::ReadOnly | QFile::Text); @@ -441,6 +446,8 @@ void kristall::setTheme(Theme theme) app->setStyleSheet(stream.readAll()); QIcon::setThemeName("light"); + + kristall::options.fancy_urlbar_dim_colour = QColor(128, 128, 128, 255); } else if(theme == Theme::dark) { @@ -450,6 +457,8 @@ void kristall::setTheme(Theme theme) app->setStyleSheet(stream.readAll()); QIcon::setThemeName("dark"); + + kristall::options.fancy_urlbar_dim_colour = QColor(150, 150, 150, 255); } } -- cgit v1.2.3