From 10189b4eb20d1b3b9579a6b51dde697691c18abd Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 16 Jun 2010 18:14:49 +0200 Subject: [PATCH] Adapt the stylesheets and the stylesheet generator to the new markerline The markerline now supports a fully styled brush rather than just reading the color and enforcing a gradient. In order to get the same look as before, we adapt the stylesheets we ship and also write out an appropriate gradient definition in settings.qss. Note that, as always in QSS, the gradient is normalized between (0,0) and (1,1). --- data/stylesheets/LinuxDolt-bluestheme.qss | 3 ++- data/stylesheets/default.qss | 3 ++- data/stylesheets/jussi01-darktheme.qss | 3 ++- data/stylesheets/m4yer.qss | 4 ++-- src/qtui/qtuistyle.cpp | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/data/stylesheets/LinuxDolt-bluestheme.qss b/data/stylesheets/LinuxDolt-bluestheme.qss index 073f2891..e6b775f6 100644 --- a/data/stylesheets/LinuxDolt-bluestheme.qss +++ b/data/stylesheets/LinuxDolt-bluestheme.qss @@ -14,7 +14,8 @@ // Custom ChatView Colors ChatView { background: #00004b; } -Palette { marker-line: #ff0000; } +Palette { marker-line: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #ff0000, stop: 0.1 transparent); } + ChatLine[label="highlight"] { foreground: #f0f5ff; background: #00008b; } diff --git a/data/stylesheets/default.qss b/data/stylesheets/default.qss index b92bd09c..cebcfb49 100644 --- a/data/stylesheets/default.qss +++ b/data/stylesheets/default.qss @@ -30,8 +30,9 @@ ChatLine::url { foreground: palette(link); } +// Markerline gets a nice (and hardly visible) gradient Palette { - marker-line: red; + marker-line: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 red, stop: 0.1 transparent); } // mIRC colors diff --git a/data/stylesheets/jussi01-darktheme.qss b/data/stylesheets/jussi01-darktheme.qss index a47bc8c2..cc7e2ede 100644 --- a/data/stylesheets/jussi01-darktheme.qss +++ b/data/stylesheets/jussi01-darktheme.qss @@ -13,7 +13,8 @@ // Copyright (C) Jussi Schultink 2009 // Custom ChatView Colors -Palette { marker-line: #ff0000; } +Palette { marker-line: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #ff0000, stop: 0.1 transparent); } + ChatView { background: #131313; } ChatLine[label="highlight"] { diff --git a/data/stylesheets/m4yer.qss b/data/stylesheets/m4yer.qss index 63191545..04204328 100644 --- a/data/stylesheets/m4yer.qss +++ b/data/stylesheets/m4yer.qss @@ -13,7 +13,7 @@ ChatLine[label="highlight"] { ChatLine::sender[label="highlight"] { background: #d7d7d7; font-weight:bold; - foreground: #0000aa; + foreground: #0000aa; } ChatLine[label="selected"] { @@ -36,7 +36,7 @@ ChatLine::timestamp { foreground: #707c70; } ChatLine::timestamp[sender="self"] { foreground: #707c70; } ChatLine::timestamp[label="highlight"] { foreground: #707c70; } -Palette { marker-line: #ff0000; } +Palette { marker-line: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #ff0000, stop: 0.1 transparent); } ChatLine::url { foreground: #0000aa; } ChatLine::url[sender="self"] { foreground: #0000aa; } diff --git a/src/qtui/qtuistyle.cpp b/src/qtui/qtuistyle.cpp index 396fb9ae..2fa8aeba 100644 --- a/src/qtui/qtuistyle.cpp +++ b/src/qtui/qtuistyle.cpp @@ -59,7 +59,8 @@ void QtUiStyle::generateSettingsQss() const { if(s.value("UseChatViewColors").toBool()) { out << "\n// Custom ChatView Colors\n" - << "Palette { marker-line: " << color("MarkerLine", s) << "; }\n" + // markerline is special in that it always used to use a gradient, so we keep this behavior even with the new implementation + << "Palette { marker-line: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 " << color("MarkerLine", s) << ", stop: 0.1 transparent); }\n" << "ChatView { background: " << color("ChatViewBackground", s) << "; }\n\n" << "ChatLine[label=\"highlight\"] {\n" << " foreground: " << color("Highlight",s) << ";\n" -- 2.20.1