From f078e8a8afe5a26bf01dbf2b6720da0f2f40773b Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 11 Sep 2020 16:08:02 +0200 Subject: [PATCH] improve restable sel/unsel colors --- src/qtgui/restable.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/qtgui/restable.cpp b/src/qtgui/restable.cpp index 7e460599..3294e18e 100644 --- a/src/qtgui/restable.cpp +++ b/src/qtgui/restable.cpp @@ -499,9 +499,14 @@ public: painter->save(); - QTextDocument document; - QString color = opt.palette.color(QPalette::Text).name(); - QString selcolor = opt.palette.color(QPalette::BrightText).name(); + /* As we draw with a text document, not the normal tableview + painter, we need to retrieve the appropriate colors and set + them as HTML styles. */ + QString color = opt.palette.color(QPalette::Base).name(); + QString textcolor = opt.palette.color(QPalette::Text).name(); + QString selcolor = opt.palette.color(QPalette::Highlight).name(); + QString seltextcolor = + opt.palette.color(QPalette::HighlightedText).name(); QString fstyle; if (prefs.reslistfontsize > 0) { int fs = prefs.reslistfontsize <= fsadjusttable ? @@ -510,6 +515,9 @@ public: } QString ntxt("