diff options
author | kotontrion <[email protected]> | 2024-12-21 00:46:34 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-12-21 00:46:34 +0100 |
commit | dafb191661d88c3182b6571461df56687ec90cdd (patch) | |
tree | 58bbf1f3018feea055ac84b44a1a27387465c548 /lib/astal/gtk3/src/widget/icon.vala | |
parent | d7d11b341db85ce9768fa06b6f225d713621ec56 (diff) |
astal3 icon: use Gtk Image's GIcon (#187)
Diffstat (limited to 'lib/astal/gtk3/src/widget/icon.vala')
-rw-r--r-- | lib/astal/gtk3/src/widget/icon.vala | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/astal/gtk3/src/widget/icon.vala b/lib/astal/gtk3/src/widget/icon.vala index 9a20359..ee6808c 100644 --- a/lib/astal/gtk3/src/widget/icon.vala +++ b/lib/astal/gtk3/src/widget/icon.vala @@ -9,7 +9,21 @@ public class Astal.Icon : Gtk.Image { private double size { get; set; default = 14; } public new Gdk.Pixbuf pixbuf { get; set; } - public GLib.Icon g_icon { get; set; } + + private static bool gicon_warned = false; + [Version (deprecated = true, deprecated_since = "0.1.0", replacement = "gicon")] + public GLib.Icon g_icon { + owned get { + return this.gicon; + } + set { + if( !gicon_warned ) { + GLib.warning("g-icon is deprecated. Use gicon instead."); + gicon_warned = true; + } + this.gicon = value; + } + } /** * Either a named icon or a path to a file. @@ -57,7 +71,6 @@ public class Astal.Icon : Gtk.Image { break; case IconType.GICON: pixel_size = (int)size; - gicon = g_icon; break; } @@ -86,7 +99,7 @@ public class Astal.Icon : Gtk.Image { display_icon.begin(); }); - notify["g-icon"].connect(() => { + notify["gicon"].connect(() => { type = IconType.GICON; display_icon.begin(); }); |