Granite.Widgets.Utils
Description:
This namespace contains functions to apply CSS stylesheets to widgets.
Content:
Functions:
- public void apply_text_style_to_label (TextStyle text_style, Label label)
This method applies given text style to given label
- public string? get_button_layout_schema ()
This methods returns the schema used by Granite.Widgets.Utils.get_default_close_button_position to determine the close button placement. It will first check for the pantheon/gala schema and then fallback to the default gnome one. If neither is available, null is returned. Make sure to check for this case, as otherwise your program may crash on startup.
- public CssProvider? get_css_provider (string stylesheet)
Constructs a new Gtk.CssProvider that will store the stylesheet data. This function uses Gtk.CssProvider.load_from_data internally so if this method fails then a warning will be thrown and null returned as a result.
- public bool get_default_close_button_position (out CloseButtonPosition position)
This method detects the close button position as configured for the window manager. If you need to know when this key changed, it's best to listen on the schema returned by Granite.Widgets.Utils.get_button_layout_schema for changes and then call this method again.
- public CssProvider? set_color_primary (Widget window, RGBA color, int priority = STYLE_PROVIDER_PRIORITY_APPLICATION)
Applies colorPrimary property to the window. The colorPrimary property currently changes the color of the Gtk.HeaderBar and it's children so that the application window can have a so-called "brand color".
- public CssProvider? set_theming (Widget widget, string stylesheet, string? class_name, int priority)
Applies the stylesheet to the widget.
- public CssProvider? set_theming_for_screen (Screen screen, string stylesheet, int priority)
Applies a stylesheet to the given screen. This will affect all the widgets which are part of that screen.