summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/js/simple-bar/widget/Bar.tsx4
-rw-r--r--examples/lua/simple-bar/widget/Bar.lua4
-rw-r--r--examples/py/simple-bar/widget/Bar.py2
-rw-r--r--examples/vala/simple-bar/widget/Bar.vala2
-rw-r--r--lib/astal/gtk3/src/widget/icon.vala19
5 files changed, 22 insertions, 9 deletions
diff --git a/examples/js/simple-bar/widget/Bar.tsx b/examples/js/simple-bar/widget/Bar.tsx
index 54a14b0..c109aec 100644
--- a/examples/js/simple-bar/widget/Bar.tsx
+++ b/examples/js/simple-bar/widget/Bar.tsx
@@ -18,9 +18,9 @@ function SysTray() {
usePopover={false}
actionGroup={bind(item, "action-group").as(ag => ["dbusmenu", ag])}
menuModel={bind(item, "menu-model")}>
- <icon gIcon={bind(item, "gicon")} />
+ <icon gicon={bind(item, "gicon")} />
</menubutton>
- ))}
+ )))}
</box>
}
diff --git a/examples/lua/simple-bar/widget/Bar.lua b/examples/lua/simple-bar/widget/Bar.lua
index 5e62253..e0d8b20 100644
--- a/examples/lua/simple-bar/widget/Bar.lua
+++ b/examples/lua/simple-bar/widget/Bar.lua
@@ -26,7 +26,7 @@ local function SysTray()
return { "dbusmenu", ag }
end),
Widget.Icon({
- g_icon = bind(item, "gicon"),
+ gicon = bind(item, "gicon"),
}),
})
end)
@@ -127,7 +127,7 @@ local function Workspaces()
end)
return map(wss, function(ws)
- if !(ws.id >= -99 and ws.id <= -2) then -- filter out special workspaces
+ if not (ws.id >= -99 and ws.id <= -2) then -- filter out special workspaces
return Widget.Button({
class_name = bind(hypr, "focused-workspace"):as(function(fw)
return fw == ws and "focused" or ""
diff --git a/examples/py/simple-bar/widget/Bar.py b/examples/py/simple-bar/widget/Bar.py
index 3c5c3f8..c6902b4 100644
--- a/examples/py/simple-bar/widget/Bar.py
+++ b/examples/py/simple-bar/widget/Bar.py
@@ -124,7 +124,7 @@ class SysTray(Gtk.Box):
icon = Astal.Icon(visible=True)
item.bind_property("tooltip-markup", btn, "tooltip-markup", SYNC)
- item.bind_property("gicon", icon, "g-icon", SYNC)
+ item.bind_property("gicon", icon, "gicon", SYNC)
item.bind_property("menu-model", btn, "menu-model", SYNC)
btn.insert_action_group("dbusmenu", item.get_action_group())
diff --git a/examples/vala/simple-bar/widget/Bar.vala b/examples/vala/simple-bar/widget/Bar.vala
index 8913c95..295a3b7 100644
--- a/examples/vala/simple-bar/widget/Bar.vala
+++ b/examples/vala/simple-bar/widget/Bar.vala
@@ -121,7 +121,7 @@ class SysTray : Gtk.Box {
var icon = new Astal.Icon() { visible = true };
item.bind_property("tooltip-markup", btn, "tooltip-markup", BindingFlags.SYNC_CREATE);
- item.bind_property("gicon", icon, "g-icon", BindingFlags.SYNC_CREATE);
+ item.bind_property("gicon", icon, "gicon", BindingFlags.SYNC_CREATE);
item.bind_property("menu-model", btn, "menu-model", BindingFlags.SYNC_CREATE);
btn.insert_action_group("dbusmenu", item.action_group);
item.notify["action-group"].connect(() => {
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();
});