@@ -7,6 +7,7 @@ public class Network.Widgets.PopoverWidget : Gtk.Box {
77 public NM . Client nm_client { get ; construct; }
88
99 public GLib . List<WidgetNMInterface > ? network_interface { get ; private owned set ; }
10+ public SimpleActionGroup action_group { get ; private set ; }
1011
1112 public bool secure { private set ; get ; default = false ; }
1213 public string ? extra_info { private set ; get ; default = null ; }
@@ -15,7 +16,7 @@ public class Network.Widgets.PopoverWidget : Gtk.Box {
1516 private Gtk . FlowBox other_box;
1617 private Gtk . Box wifi_box;
1718 private Gtk . Box vpn_box;
18- private Gtk . ModelButton hidden_item;
19+ private Wingpanel . PopoverMenuItem hidden_item;
1920 private Gtk . Revealer toggle_revealer;
2021
2122 public bool is_in_session { get ; construct; }
@@ -62,7 +63,7 @@ public class Network.Widgets.PopoverWidget : Gtk.Box {
6263 text = _ ("Airplane Mode ")
6364 };
6465
65- var action_group = new SimpleActionGroup ();
66+ action_group = new SimpleActionGroup ();
6667 action_group.action_state_changed.connect ((action_name , state ) => {
6768 if (action_name == " airplane-mode" ) {
6869 if (state. get_boolean ()) {
@@ -81,35 +82,35 @@ public class Network.Widgets.PopoverWidget : Gtk.Box {
8182 child = airplane_toggle
8283 };
8384
84- other_box.add (airplane_child );
85+ other_box.append (airplane_child );
8586
8687 var other_sep = new Gtk .Separator (Gtk . Orientation . HORIZONTAL ) {
8788 margin_top = 3 ,
8889 margin_bottom = 3
8990 };
9091
9192 var toggle_box = new Gtk .Box (Gtk . Orientation . VERTICAL , 0 );
92- toggle_box.add (other_box );
93- toggle_box.add (other_sep );
93+ toggle_box.append (other_box );
94+ toggle_box.append (other_sep );
9495
9596 toggle_revealer = new Gtk .Revealer () {
9697 child = toggle_box
9798 };
9899
99- add (toggle_revealer );
100- add (vpn_box );
101- add (wifi_box );
100+ append (toggle_revealer );
101+ append (vpn_box );
102+ append (wifi_box );
102103
103104 if (is_in_session ) {
104- hidden_item = new Gtk . ModelButton ();
105+ hidden_item = new Wingpanel . PopoverMenuItem ();
105106 hidden_item. text = _(" Connect to Hidden Network…" );
106- hidden_item. no_show_all = true ;
107+ hidden_item. visible = false ;
107108
108- var show_settings_button = new Gtk . ModelButton ();
109+ var show_settings_button = new Wingpanel . PopoverMenuItem ();
109110 show_settings_button. text = _(" Network Settings…" );
110111
111- add (hidden_item);
112- add (show_settings_button);
112+ append (hidden_item);
113+ append (show_settings_button);
113114
114115 show_settings_button. clicked. connect (show_settings);
115116 }
@@ -124,7 +125,6 @@ public class Network.Widgets.PopoverWidget : Gtk.Box {
124125 }
125126
126127 toggle_revealer. reveal_child = other_box.get_child_at_index (0 ) != null;
127- show_all ();
128128 update_vpn_connection ();
129129
130130 hidden_item.clicked.connect (() => {
@@ -148,23 +148,21 @@ public class Network.Widgets.PopoverWidget : Gtk.Box {
148148
149149 private void add_interface (WidgetNMInterface widget_interface) {
150150 if (widget_interface is EtherInterface || widget_interface is ModemInterface) {
151-
152151 var flowboxchild = new Gtk .FlowBoxChild () {
153152 // Prevent weird double focus border
154153 can_focus = false ,
155154 child = widget_interface
156155 };
157156
158- other_box.add (flowboxchild );
157+ other_box.append (flowboxchild );
159158 return ;
160159 }
161160
162161 var container_box = wifi_box;
163162
164163 if (widget_interface is Network.WifiInterface) {
165164 container_box = wifi_box;
166- hidden_item. no_show_all = false ;
167- hidden_item.show_all ();
165+ hidden_item. visible = true ;
168166
169167 ((Network . WifiInterface ) widget_interface). notify["hidden-sensitivity"].connect (() => {
170168 bool hidden_sensitivity = false ;
@@ -183,11 +181,11 @@ public class Network.Widgets.PopoverWidget : Gtk.Box {
183181 container_box = vpn_box;
184182 }
185183
186- if (is_in_session && get_children (). length () > 0 ) {
187- container_box. pack_end (widget_interface. sep);
188- }
184+ container_box. append (widget_interface);
189185
190- container_box. pack_end (widget_interface);
186+ if (is_in_session && get_first_child != null ) {
187+ container_box. append (widget_interface. sep);
188+ }
191189 }
192190
193191 public void opened () {
@@ -287,7 +285,6 @@ public class Network.Widgets.PopoverWidget : Gtk.Box {
287285
288286 toggle_revealer. reveal_child = other_box. get_child_at_index (0 ) != null ;
289287 update_state ();
290- show_all ();
291288 }
292289
293290 private void update_state () {
0 commit comments