diff options
| author | Mike Skec <skec@protonmail.ch> | 2021-01-02 12:20:34 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-01-02 12:41:49 +0100 |
| commit | 05df68b1331dbfdf9aff98139a9a1f96f147e651 (patch) | |
| tree | 3f84db83e289a37166ef84fe7422f668ef8a92d9 /src/main.cpp | |
| parent | b35e6959aef83d9d0873621513d7d7d33d9f141e (diff) | |
| download | kristall-05df68b1331dbfdf9aff98139a9a1f96f147e651.tar.gz | |
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
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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); } } |
