File tree Expand file tree Collapse file tree 2 files changed +9
-23
lines changed Expand file tree Collapse file tree 2 files changed +9
-23
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public class Sample.Indicator : Wingpanel.Indicator {
2626 private Gtk . Overlay display_widget;
2727
2828 /* The main widget that is displayed in the popover */
29- private Gtk . Grid main_widget;
29+ private Gtk . Box main_widget;
3030
3131 public Indicator () {
3232 /* Some information about the indicator */
@@ -62,10 +62,10 @@ public class Sample.Indicator : Wingpanel.Indicator {
6262
6363 var compositing_switch = new Granite .SwitchModelButton (_(" Composited Icon" ));
6464
65- main_widget = new Gtk .Grid ( );
66- main_widget. attach (hide_button, 0 , 0 );
67- main_widget. attach (separator, 0 , 1 );
68- main_widget. attach (compositing_switch, 0 , 2 );
65+ main_widget = new Gtk .Box ( VERTICAL , 0 );
66+ main_widget. append (hide_button);
67+ main_widget. append (separator);
68+ main_widget. append (compositing_switch);
6969
7070 /* Indicator should be visible at startup */
7171 this . visible = true ;
Original file line number Diff line number Diff line change 1818 */
1919
2020public class Wingpanel.Widgets.IndicatorPopover : Gtk .Popover {
21- private unowned Gtk . Widget ? widget = null ;
22-
23- private Gtk . Box container;
21+ private Granite . Bin container;
2422
2523 construct {
2624 width_request = 256 ;
2725 name = name + " /popover" ;
2826 position = Gtk . PositionType . BOTTOM ;
2927
30- container = new Gtk . Box ( Gtk . Orientation . HORIZONTAL , 0 ) {
28+ container = new Granite . Bin ( ) {
3129 margin_top = 3 ,
32- margin_bottom = 3
30+ margin_bottom = 3 ,
3331 };
3432
3533 child = container;
3634 }
3735
3836 public void set_content (Gtk .Widget ? content ) {
39- if (content == widget) {
40- return ;
41- }
42-
43- if (widget != null ) {
44- container. remove (widget);
45- widget = null ;
46- }
47-
48- if (content != null ) {
49- container. append (content);
50- widget = content;
51- }
37+ container. child = content;
5238 }
5339}
You can’t perform that action at this time.
0 commit comments