Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with newer Vala #637

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions demo/Views/UtilsView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ public class UtilsView : Gtk.Grid {
Granite.contrasting_foreground_color (bg_color).to_string ()
);

#if VALA_0_58
provider.load_from_data (css);
#else
provider.load_from_data ((uint8[])css);
#endif
demo_label_style_context.add_provider (
provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
Expand Down
4 changes: 4 additions & 0 deletions lib/Widgets/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ namespace Granite.Widgets.Utils {
var css = "@define-color color_primary %s;".printf (color.to_string ());

var css_provider = new Gtk.CssProvider ();
#if VALA_0_58
css_provider.load_from_data (css);
#else
css_provider.load_from_data (css.data);
#endif

Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), css_provider, priority);

Expand Down