From 7a75413fc1314c6c837141e0f8e9dcbbaf3f7016 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sun, 11 Jun 2017 21:31:49 +0200 Subject: [PATCH] Ref T84, fix for better readibility of news / hyperlinks * adjust palette to change link color: hardcoded, but no other way per stylesheet * stylesheet fix to avoid black font in table view (CTRL S) Remark: Currently we just display the blog page as news, which is not correctly formatted, but somehow works. In the future we might use a tailored HTML page for that. --- src/blackgui/guiapplication.cpp | 13 +++++++++++++ src/blackgui/guiapplication.h | 3 +++ src/blackgui/share/qss/stdwidget.qss | 2 ++ src/blackgui/share/qss/swiftlauncher.qss | 9 +++++---- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index dd8f490bc..3b56a9a3c 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -79,6 +79,7 @@ namespace BlackGui { CGuiApplication::registerMetadata(); CApplication::init(false); // base class without metadata + CGuiApplication::adjustPalette(); this->setWindowIcon(icon); this->settingsChanged(); sGui = this; @@ -665,4 +666,16 @@ namespace BlackGui { this->checkNewVersion(false); } + + void CGuiApplication::adjustPalette() + { + // only way to change link color + // https://stackoverflow.com/q/5497799/356726 + // Ref T84 + QPalette newPalette(qApp->palette()); + const QColor linkColor(135, 206, 250); + newPalette.setColor(QPalette::Link, linkColor); + newPalette.setColor(QPalette::LinkVisited, linkColor); + qApp->setPalette(newPalette); + } } // ns diff --git a/src/blackgui/guiapplication.h b/src/blackgui/guiapplication.h index a9daf48e1..203feb246 100644 --- a/src/blackgui/guiapplication.h +++ b/src/blackgui/guiapplication.h @@ -229,6 +229,9 @@ namespace BlackGui //! Check new from menu void checkNewVersionMenu(); + + //! Fix the palette for better readibility + void adjustPalette(); }; } // ns diff --git a/src/blackgui/share/qss/stdwidget.qss b/src/blackgui/share/qss/stdwidget.qss index e857f8a00..ebf8c8604 100644 --- a/src/blackgui/share/qss/stdwidget.qss +++ b/src/blackgui/share/qss/stdwidget.qss @@ -534,8 +534,10 @@ QTableView, QTreeView, QListView { padding:0px; } +/** explicitly setting font color avoids black when pressing CTRL-S **/ QTableView::item:selected { background-color: blue; + color: white; } QTreeView { diff --git a/src/blackgui/share/qss/swiftlauncher.qss b/src/blackgui/share/qss/swiftlauncher.qss index 2d4fd59d2..ebf7e5b7a 100644 --- a/src/blackgui/share/qss/swiftlauncher.qss +++ b/src/blackgui/share/qss/swiftlauncher.qss @@ -1,7 +1,8 @@ -/** Works around two issues on Mac OS - 1. The launcher dialog was entirely transparent - 2. Transparency caused the QToolBox labels to be broken -*/ +/** +Works around two issues on Mac OS + 1. The launcher dialog was entirely transparent + 2. Transparency caused the QToolBox labels to be broken +**/ QStackedWidget#sw_SwiftLauncher { background-image: url(:/textures/icons/textures/texture-inner.jpg); }