[Xfce4-commits] <postler:master> Separate fallback theme from behavior styles
Christian Dywan
noreply at xfce.org
Tue Jun 28 05:10:04 CEST 2011
Updating branch refs/heads/master
to 1ed0643a4fa502c3a4cea5caacd1a64f44989f9c (commit)
from 39d1944384ae42034ac6c2e40c41333b3d257adb (commit)
commit 1ed0643a4fa502c3a4cea5caacd1a64f44989f9c
Author: Christian Dywan <christian at twotoasts.de>
Date: Mon Jun 27 23:19:40 2011 +0200
Separate fallback theme from behavior styles
postler/postler-content.vala | 67 ++++++++++++++++++++++-------------------
1 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 608cdc3..90ce146 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -36,40 +36,55 @@ public class Postler.Content : WebKit.WebView {
Gtk.Settings gtk_settings;
GLib.Settings glib_settings;
+ const string fallback_style_sheet = """
+ body {
+ background-color: Window !important; color: WindowText !important;
+ }
+ .header {
+ background-color: Window !important; color: WindowText !important;
+ }
+ .reply {
+ border-radius: 15px;
+ border: 1px solid ButtonText;
+ background-color: ButtonFace; color: ButtonText;
+ padding: 1em; margin: 1em;
+ }
+ .time {
+ float: right;
+ }
+ .sender {
+ margin-bottom: 0.5em;
+ }
+ /* Addresses not underlined, but underlined when hovering */
+ a {
+ color: Link !important;
+ }
+ a[href] {
+ text-decoration: underline !important;
+ }
+ a[href]:hover {
+ text-decoration: none !important;
+ }
+ """;
+
const string style_sheet = """
.headers {
display: block;
- background-color: Window !important; color: WindowText !important;
font-size: 100% !important;
- margin: 0em;
- padding: 0.5em;
+ margin: 0em; padding: 0.5em;
}
.headers #extra_headers {
display: none;
}
* {
- padding: 0em;
- margin: 0em;
+ padding: 0em; margin: 0em;
}
body {
- background-color: Window !important; color: WindowText !important;
padding: 1em; margin: 0 !important;
}
.body {
font-size: 100% !important;
}
- .reply {
- border-radius: 15px;
- border: 1px solid ButtonText;
- background-color: ButtonFace; color: ButtonText;
- padding: 1em; margin: 1em;
- }
- .sender {
- margin-bottom: 0.5em;
- }
- .time {
- float: right;
- }
.no_signature .signature {
display: none;
}
@@ -92,16 +107,6 @@ public class Postler.Content : WebKit.WebView {
.signature:before {
content: "——";
}
- /* Addresses not underlined, but underlined when hovering */
- a {
- color: Link !important;
- }
- a[href] {
- text-decoration: underline !important;
- }
- a[href]:hover {
- text-decoration: none !important;
- }
/* Dynamically sized and visible statusbar */
a[href^=http]:hover:after {
content: attr(href);
@@ -650,7 +655,7 @@ public class Postler.Content : WebKit.WebView {
</div>
</div>
""";
- content_stylesheet = "";
+ content_stylesheet = themed_style_sheet ();
}
message_parts = new GLib.List<MessagePart> ();
@@ -754,7 +759,7 @@ public class Postler.Content : WebKit.WebView {
<div class="body">%s</div>
"""
.printf (
- themed_style_sheet () + content_stylesheet,
+ style_sheet + content_stylesheet,
message.subject,
/* FIXME: Merge all recipients here? */
linkify_address (message.recipients, arguments),
@@ -856,7 +861,7 @@ public class Postler.Content : WebKit.WebView {
/* Use void* with style_get to avoid Vala compiler error */
void* link_color;
widget.style_get ("link-color", out link_color);
- return style_sheet.replace (
+ return fallback_style_sheet.replace (
"ButtonText", color_to_rgb (widget.style.fg[state])).replace (
"ButtonFace", color_to_rgb (widget.style.bg[state])).replace (
"WindowText", color_to_rgb (widget.style.fg[state])).replace (
More information about the Xfce4-commits
mailing list