diff --git a/src/qtgui/guiutils.cpp b/src/qtgui/guiutils.cpp index e00c67b4..b18a2948 100644 --- a/src/qtgui/guiutils.cpp +++ b/src/qtgui/guiutils.cpp @@ -27,6 +27,7 @@ #include "base64.h" #include "advshist.h" +#include #include #include #include @@ -146,6 +147,8 @@ void rwSettings(bool writing) SETTING_RW(prefs.reslistfontsize, "/Recoll/prefs/reslist/fontSize", Int, 10); + prefs.fontcolor = QApplication::palette().text().color().name(); + QString rlfDflt = QString::fromUtf8(prefs.dfltResListFormat); if (writing) { if (prefs.reslistformat.compare(rlfDflt)) { diff --git a/src/qtgui/guiutils.h b/src/qtgui/guiutils.h index 114258c1..ec54d3e1 100644 --- a/src/qtgui/guiutils.h +++ b/src/qtgui/guiutils.h @@ -50,6 +50,10 @@ class PrefsPack { int respagesize; int maxhltextmbs; QString reslistfontfamily; + // Not saved in prefs for now. Computed from qt defaults and used to + // set main character color for webkit/textbrowser reslist and + // snippets window. + QString fontcolor; QString qtermcolor; // Color for query terms in reslist and preview int reslistfontsize; // Result list format string diff --git a/src/qtgui/reslist.cpp b/src/qtgui/reslist.cpp index 65673791..4cad0651 100644 --- a/src/qtgui/reslist.cpp +++ b/src/qtgui/reslist.cpp @@ -183,15 +183,17 @@ string QtGuiResListPager::prevUrl() string QtGuiResListPager::headerContent() { string out; -#ifdef SETFONT_WITH_HEADSTYLE + out = "\n"); #endif + out += string("color: ") + qs2utf8s(prefs.fontcolor) + ";\n"; + out += string("}\n\n"); out += qs2utf8s(prefs.reslistheadertext); return out; } diff --git a/src/qtgui/snippets_w.cpp b/src/qtgui/snippets_w.cpp index e9dda01a..53e070f1 100644 --- a/src/qtgui/snippets_w.cpp +++ b/src/qtgui/snippets_w.cpp @@ -144,14 +144,19 @@ void SnippetsW::init() ostringstream oss; oss << - "" - "" - "" - "" - "" - "" - ; + "" + ""; + + oss << "\n"; + + oss << + "" + "" + "
" + ; g_hiliter.set_inputhtml(false); bool nomatch = true;