aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/util.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-15 01:02:34 +0100
committerfiaxh <git@mx.ax.lt>2017-03-15 21:55:26 +0100
commit7ab4752b2438fac9c07745314f7cd428103f9b4c (patch)
tree1eab9bc58fe8838ab084a07e057d0a64e04095c4 /main/src/ui/util.vala
parent4faee9f08dca187b04a6f5719fe766a3b4375460 (diff)
downloaddino-7ab4752b2438fac9c07745314f7cd428103f9b4c.tar.gz
dino-7ab4752b2438fac9c07745314f7cd428103f9b4c.zip
Indication of WONTSEND via CSS (@error_color on message status)
Diffstat (limited to 'main/src/ui/util.vala')
-rw-r--r--main/src/ui/util.vala18
1 files changed, 16 insertions, 2 deletions
diff --git a/main/src/ui/util.vala b/main/src/ui/util.vala
index 34df82d8..9ed28b1f 100644
--- a/main/src/ui/util.vala
+++ b/main/src/ui/util.vala
@@ -77,20 +77,34 @@ public class Util : Object {
}
private const string force_background_css = "%s { background-color: %s; }";
+ private const string force_color_css = "%s { color: %s; }";
- public static void force_background(Gtk.Widget widget, string color, string selector = "*") {
+
+ private static void force_css(Gtk.Widget widget, string css) {
var p = new Gtk.CssProvider();
try {
- p.load_from_data(force_background_css.printf(selector, color));
+ p.load_from_data(css);
widget.get_style_context().add_provider(p, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
} catch (GLib.Error err) {
// handle err
}
}
+ public static void force_background(Gtk.Widget widget, string color, string selector = "*") {
+ force_css(widget, force_background_css.printf(selector, color));
+ }
+
public static void force_base_background(Gtk.Widget widget, string selector = "*") {
force_background(widget, "@theme_base_color", selector);
}
+
+ public static void force_color(Gtk.Widget widget, string color, string selector = "*") {
+ force_css(widget, force_color_css.printf(selector, color));
+ }
+
+ public static void force_error_color(Gtk.Widget widget, string selector = "*") {
+ force_color(widget, "@error_color", selector);
+ }
}
} \ No newline at end of file