mouse-panel: Port to AdwSwitchRow

This commit is contained in:
Hari Rana 2024-01-07 22:59:30 -05:00 committed by Felipe Borges
parent 4112e30591
commit 1367e3b1ef
2 changed files with 7 additions and 15 deletions

View file

@ -58,8 +58,7 @@ struct _CcMousePanel
CcSplitRow *touchpad_scroll_method_row;
GtkListBoxRow *touchpad_speed_row;
GtkScale *touchpad_speed_scale;
AdwActionRow *touchpad_toggle_row;
GtkSwitch *touchpad_toggle_switch;
AdwSwitchRow *touchpad_toggle_row;
AdwSwitchRow *touchpad_typing_row;
GSettings *mouse_settings;
@ -351,7 +350,7 @@ setup_dialog (CcMousePanel *self)
gtk_widget_set_visible (GTK_WIDGET (self->touchpad_toggle_row), can_disable_touchpad (self));
g_settings_bind_with_mapping (self->touchpad_settings, "send-events",
self->touchpad_toggle_switch, "active",
self->touchpad_toggle_row, "active",
G_SETTINGS_BIND_DEFAULT,
touchpad_enabled_get_mapping,
touchpad_enabled_set_mapping,
@ -527,7 +526,6 @@ cc_mouse_panel_class_init (CcMousePanelClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcMousePanel, touchpad_stack_page);
gtk_widget_class_bind_template_child (widget_class, CcMousePanel, touchpad_speed_scale);
gtk_widget_class_bind_template_child (widget_class, CcMousePanel, touchpad_toggle_row);
gtk_widget_class_bind_template_child (widget_class, CcMousePanel, touchpad_toggle_switch);
gtk_widget_class_bind_template_child (widget_class, CcMousePanel, touchpad_typing_row);
gtk_widget_class_bind_template_child (widget_class, CcMousePanel, two_finger_push_row);

View file

@ -192,15 +192,9 @@
<child>
<object class="AdwPreferencesGroup" id="touchpad_group">
<child>
<object class="AdwActionRow" id="touchpad_toggle_row">
<object class="AdwSwitchRow" id="touchpad_toggle_row">
<property name="title" translatable="yes">T_ouchpad</property>
<property name="use-underline">True</property>
<property name="activatable-widget">touchpad_toggle_switch</property>
<child>
<object class="GtkSwitch" id="touchpad_toggle_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
@ -213,7 +207,7 @@
<object class="AdwActionRow" id="touchpad_speed_row">
<property name="title" translatable="yes">Po_inter Speed</property>
<property name="use-underline">True</property>
<property name="sensitive" bind-source="touchpad_toggle_switch" bind-property="active" bind-flags="default|sync-create" />
<property name="sensitive" bind-source="touchpad_toggle_row" bind-property="active" bind-flags="default|sync-create" />
<child type="suffix">
<object class="GtkScale" id="touchpad_speed_scale">
<property name="hexpand">True</property>
@ -264,7 +258,7 @@
<property name="use-underline">True</property>
<property name="subtitle" translatable="yes">Quickly touch the touchpad to click</property>
<property name="activatable-widget">tap_to_click_switch</property>
<property name="sensitive" bind-source="touchpad_toggle_switch" bind-property="active" bind-flags="default|sync-create" />
<property name="sensitive" bind-source="touchpad_toggle_row" bind-property="active" bind-flags="default|sync-create" />
<child>
<object class="GtkSwitch" id="tap_to_click_switch">
<property name="valign">center</property>
@ -285,7 +279,7 @@
<property name="default-option-subtitle" translatable="yes">Drag two fingers on the touchpad</property>
<property name="alternative-option-title" translatable="yes">_Edge</property>
<property name="alternative-option-subtitle" translatable="yes">Drag one finger on the edge</property>
<property name="sensitive" bind-source="touchpad_toggle_switch" bind-property="active" bind-flags="default|sync-create" />
<property name="sensitive" bind-source="touchpad_toggle_row" bind-property="active" bind-flags="default|sync-create" />
<signal name="notify::use-default" handler="on_touchpad_scroll_method_changed_cb" object="CcMousePanel" swapped="yes"/>
</object>
</child>
@ -299,7 +293,7 @@
<property name="default-option-title" translatable="yes">T_raditional</property>
<property name="default-option-subtitle" translatable="yes">Scrolling moves the view</property>
<property name="alternative-option-title" translatable="yes">_Natural</property>
<property name="sensitive" bind-source="touchpad_toggle_switch" bind-property="active" bind-flags="default|sync-create" />
<property name="sensitive" bind-source="touchpad_toggle_row" bind-property="active" bind-flags="default|sync-create" />
<property name="alternative-option-subtitle" translatable="yes">Scrolling moves the content</property>
</object>
</child>