File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ public class Icon : Gtk.Image {
10
10
11
11
public new Gdk.Pixbuf pixbuf { get ; set ; }
12
12
public string icon { get ; set ; default = " " ; }
13
+ public GLib . Icon g_icon {get ; set ;}
13
14
14
15
private async void display_icon () {
15
16
switch (type) {
@@ -45,6 +46,11 @@ public class Icon : Gtk.Image {
45
46
set_from_surface(cs);
46
47
}
47
48
break ;
49
+ case IconType . GICON:
50
+ pixel_size = (int )size;
51
+ gicon = g_icon;
52
+ break ;
53
+
48
54
}
49
55
}
50
56
@@ -71,6 +77,11 @@ public class Icon : Gtk.Image {
71
77
display_icon. begin();
72
78
});
73
79
80
+ notify[" g-icon" ]. connect(() = > {
81
+ type = IconType . GICON ;
82
+ display_icon. begin();
83
+ });
84
+
74
85
size_allocate. connect(() = > {
75
86
size = get_style_context()
76
87
.get_property(" font-size" , Gtk . StateFlags . NORMAL ). get_double();
@@ -91,5 +102,6 @@ private enum IconType {
91
102
NAMED ,
92
103
FILE ,
93
104
PIXBUF ,
105
+ GICON ,
94
106
}
95
107
}
You can’t perform that action at this time.
0 commit comments