File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 <gresource prefix =" /io/elementary/wingpanel/network" >
44 <file compressed = " true" >Indicator.css</file >
55
6+ <file alias =" scalable/status/airplane-mode-symbolic.svg" compressed =" true" preprocess =" xml-stripblanks" >16/airplane-mode-symbolic.svg</file >
7+ <file alias =" scalable/status/airplane-mode-disabled-symbolic.svg" compressed =" true" preprocess =" xml-stripblanks" >16/airplane-mode-disabled-symbolic.svg</file >
8+
69 <file alias =" 16x16/status/panel-network-cellular-acquiring-symbolic.svg" compressed =" true" preprocess =" xml-stripblanks" >16/network-cellular-acquiring-symbolic.svg</file >
710 <file alias =" 16x16/status/panel-network-cellular-connected-symbolic.svg" compressed =" true" preprocess =" xml-stripblanks" >16/network-cellular-connected-symbolic.svg</file >
811 <file alias =" 16x16/status/panel-network-cellular-disconnected-symbolic.svg" compressed =" true" preprocess =" xml-stripblanks" >16/network-cellular-disconnected-symbolic.svg</file >
Original file line number Diff line number Diff line change @@ -80,11 +80,9 @@ public class Network.Indicator : Wingpanel.Indicator {
8080 );
8181 });
8282
83- var action_group = new SimpleActionGroup ( );
83+ var action_group = ( SimpleActionGroup ) popover_widget . get_action_group ( " network " );
8484 action_group. add_action (airplane_action);
8585
86- popover_widget. insert_action_group (" network" , action_group);
87-
8886 update_tooltip ();
8987 on_state_changed ();
9088 start_monitor ();
Original file line number Diff line number Diff line change @@ -58,11 +58,25 @@ public class Network.Widgets.PopoverWidget : Gtk.Box {
5858 if (is_in_session) {
5959 var airplane_toggle = new SettingsToggle () {
6060 action_name = " network.airplane-mode" ,
61- icon_name = " airplane-mode-symbolic" ,
61+ icon_name = " airplane-mode-disabled- symbolic" ,
6262 settings_uri = " settings://network" ,
6363 text = _ ("Airplane Mode ")
6464 };
6565
66+ var action_group = new SimpleActionGroup ();
67+ action_group.action_state_changed.connect ((action_name , state ) => {
68+ critical (" got a state change" );
69+ if (action_name == " airplane-mode" ) {
70+ if (state. get_boolean ()) {
71+ airplane_toggle. icon_name = " airplane-mode-symbolic" ;
72+ } else {
73+ airplane_toggle. icon_name = " airplane-mode-disabled-symbolic" ;
74+ }
75+ }
76+ });
77+
78+ insert_action_group ("network ", action_group );
79+
6680 var airplane_child = new Gtk .FlowBoxChild () {
6781 // Prevent weird double focus border
6882 can_focus = false ,
You can’t perform that action at this time.
0 commit comments