44 */
55
66public class MouseTouchpad.TouchpadView : Switchboard .SettingsPage {
7- private GLib . Settings glib_settings;
8- private Gtk . CheckButton areas_click_method_radio;
9- private Gtk . CheckButton multitouch_click_method_radio;
10- private Gtk . CheckButton other_click_method_radio;
11-
127 public TouchpadView () {
138 Object (
149 icon: new ThemedIcon (" input-touchpad" ),
@@ -34,7 +29,10 @@ public class MouseTouchpad.TouchpadView : Switchboard.SettingsPage {
3429 mnemonic_widget = pointer_speed_scale
3530 };
3631
37- multitouch_click_method_radio = new Gtk .CheckButton ();
32+ var multitouch_click_method_radio = new Gtk .CheckButton () {
33+ action_name = " touchpad.click-method" ,
34+ action_target = new Variant .string (" fingers" ),
35+ };
3836 multitouch_click_method_radio. add_css_class (" image-button" );
3937
4038 var multitouch_click_method_label = new Gtk .Label (_(" Multitouch" ));
@@ -48,8 +46,9 @@ public class MouseTouchpad.TouchpadView : Switchboard.SettingsPage {
4846 multitouch_click_method_box. append (multitouch_click_method_label);
4947 multitouch_click_method_box. set_parent (multitouch_click_method_radio);
5048
51- areas_click_method_radio = new Gtk .CheckButton () {
52- group = multitouch_click_method_radio
49+ var areas_click_method_radio = new Gtk .CheckButton () {
50+ action_name = " touchpad.click-method" ,
51+ action_target = new Variant .string (" areas" ),
5352 };
5453 areas_click_method_radio. add_css_class (" image-button" );
5554
@@ -156,7 +155,7 @@ public class MouseTouchpad.TouchpadView : Switchboard.SettingsPage {
156155
157156 child = content_box;
158157
159- glib_settings = new GLib .Settings (" org.gnome.desktop.peripherals.touchpad" );
158+ var glib_settings = new GLib .Settings (" org.gnome.desktop.peripherals.touchpad" );
160159 glib_settings.bind (
161160 "disable -while -typing ",
162161 disable_while_typing_check ,
@@ -210,23 +209,10 @@ public class MouseTouchpad.TouchpadView : Switchboard.SettingsPage {
210209 null , null
211210 );
212211
213- /* This exists so that users can select another option if clicking is
214- * set from another interface like dconf or Terminal
215- */
216- other_click_method_radio = new Gtk .CheckButton () {
217- group = multitouch_click_method_radio
218- };
219-
220- update_click_method ();
221- glib_settings.changed["click-method"].connect (update_click_method );
212+ var action_group = new SimpleActionGroup ();
213+ action_group.add_action (glib_settings .create_action ("click -method "));
222214
223- multitouch_click_method_radio.toggled.connect (() => {
224- glib_settings. set_string (" click-method" , " fingers" );
225- });
226-
227- areas_click_method_radio.toggled.connect (() => {
228- glib_settings. set_string (" click-method" , " areas" );
229- });
215+ insert_action_group ("touchpad ", action_group );
230216
231217 /* This exists so that users can select another option if scrolling is
232218 * disabled from another interface like dconf or Terminal
@@ -258,18 +244,4 @@ public class MouseTouchpad.TouchpadView : Switchboard.SettingsPage {
258244 edge_scroll_radio. active = true ;
259245 }
260246 }
261-
262- private void update_click_method () {
263- switch (glib_settings. get_string (" click-method" )) {
264- case " fingers" :
265- multitouch_click_method_radio. active = true ;
266- break ;
267- case " areas" :
268- areas_click_method_radio. active = true ;
269- break ;
270- default:
271- other_click_method_radio. active = true ;
272- break ;
273- }
274- }
275247}
0 commit comments