diff options
author | Marvin W <git@larma.de> | 2023-08-24 20:18:26 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2023-09-24 19:51:33 +0200 |
commit | 9eafe4139d6b2c0cabe3c77a903d6ae931a26975 (patch) | |
tree | 7a1fa0a2a5fc25b9b8dfe2688a9f622fbd742d70 /main/src/ui/util | |
parent | 2fba24ccae13e832bd38ff9c7fea71c1a802603d (diff) | |
download | dino-9eafe4139d6b2c0cabe3c77a903d6ae931a26975.tar.gz dino-9eafe4139d6b2c0cabe3c77a903d6ae931a26975.zip |
Fix build on some Vala compiler versions
See https://gitlab.gnome.org/GNOME/vala/-/issues/1474 and https://gitlab.gnome.org/GNOME/vala/-/issues/1478
Diffstat (limited to 'main/src/ui/util')
-rw-r--r-- | main/src/ui/util/helper.vala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala index d6da72dd..63288fc2 100644 --- a/main/src/ui/util/helper.vala +++ b/main/src/ui/util/helper.vala @@ -103,7 +103,13 @@ private const string force_color_css = "%s { color: %s; }"; public static Gtk.CssProvider force_css(Gtk.Widget widget, string css) { var p = new Gtk.CssProvider(); try { +#if GTK_4_12 && (VALA_0_56_GREATER_11 || VALA_0_58) + p.load_from_string(css); +#elif (VALA_0_56_11 || VALA_0_56_12) + p.load_from_data(css, css.length); +#else p.load_from_data(css.data); +#endif widget.get_style_context().add_provider(p, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); } catch (GLib.Error err) { // handle err |