mouse: Sensitivity and acceleration sliders merge
https://bugzilla.gnome.org/show_bug.cgi?id=677206
This commit is contained in:
parent
a6262b0ad4
commit
9f76e89661
2 changed files with 43 additions and 216 deletions
|
@ -134,6 +134,25 @@ synaptics_check_capabilities (GtkBuilder *dialog)
|
|||
XFreeDeviceList (devicelist);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_speed_scale_event (GtkRange *scale, GtkBuilder *dialog)
|
||||
{
|
||||
gdouble value;
|
||||
GSettings *settings;
|
||||
GtkAdjustment *adjustment;
|
||||
|
||||
if (GTK_WIDGET (scale) == WID ("pointer_speed_scale"))
|
||||
settings = mouse_settings;
|
||||
else
|
||||
settings = touchpad_settings;
|
||||
|
||||
g_settings_set_double (settings, "motion-acceleration", gtk_range_get_value (scale));
|
||||
|
||||
adjustment = gtk_range_get_adjustment (scale);
|
||||
value = gtk_adjustment_get_upper (adjustment) - gtk_range_get_value (scale) + 1;
|
||||
g_settings_set_int (settings, "motion-threshold", value);
|
||||
}
|
||||
|
||||
/* Set up the property editors in the dialog. */
|
||||
static void
|
||||
setup_dialog (GtkBuilder *dialog)
|
||||
|
@ -157,12 +176,8 @@ setup_dialog (GtkBuilder *dialog)
|
|||
G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
/* speed */
|
||||
g_settings_bind (mouse_settings, "motion-acceleration",
|
||||
gtk_range_get_adjustment (GTK_RANGE (WID ("acceleration_scale"))), "value",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
g_settings_bind (mouse_settings, "motion-threshold",
|
||||
gtk_range_get_adjustment (GTK_RANGE (WID ("sensitivity_scale"))), "value",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
g_signal_connect (WID ("pointer_speed_scale"), "value-changed",
|
||||
G_CALLBACK (pointer_speed_scale_event), dialog);
|
||||
|
||||
/* Trackpad page */
|
||||
touchpad_present = touchpad_is_present ();
|
||||
|
@ -181,12 +196,9 @@ setup_dialog (GtkBuilder *dialog)
|
|||
g_settings_bind (touchpad_settings, "tap-to-click",
|
||||
WID ("tap_to_click_toggle"), "active",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
g_settings_bind (touchpad_settings, "motion-acceleration",
|
||||
gtk_range_get_adjustment (GTK_RANGE (WID ("touchpad_acceleration_scale"))), "value",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
g_settings_bind (touchpad_settings, "motion-threshold",
|
||||
gtk_range_get_adjustment (GTK_RANGE (WID ("touchpad_sensitivity_scale"))), "value",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
g_signal_connect (WID ("touchpad_pointer_speed_scale"), "value-changed",
|
||||
G_CALLBACK (pointer_speed_scale_event), dialog);
|
||||
|
||||
if (touchpad_present) {
|
||||
synaptics_check_capabilities (dialog);
|
||||
|
@ -206,25 +218,19 @@ create_dialog (GtkBuilder *dialog)
|
|||
|
||||
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
gtk_size_group_add_widget (size_group, WID ("primary_button_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("acceleration_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("sensitivity_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("pointer_speed_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("double_click_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("touchpad_acceleration_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("touchpad_sensitivity_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("touchpad_pointer_speed_label"));
|
||||
|
||||
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
gtk_size_group_add_widget (size_group, WID ("acceleration_fast_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("sensitivity_high_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("pointer_speed_fast_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("double_click_fast_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("touchpad_acceleration_fast_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("touchpad_sensitivity_high_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("touchpad_pointer_speed_fast_label"));
|
||||
|
||||
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
gtk_size_group_add_widget (size_group, WID ("acceleration_slow_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("sensitivity_low_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("pointer_speed_slow_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("double_click_slow_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("touchpad_acceleration_slow_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("touchpad_sensitivity_low_label"));
|
||||
gtk_size_group_add_widget (size_group, WID ("touchpad_pointer_speed_slow_label"));
|
||||
}
|
||||
|
||||
/* Callback issued when a button is clicked on the dialog */
|
||||
|
|
|
@ -15,20 +15,6 @@
|
|||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment2">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">10</property>
|
||||
<property name="value">1</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment22">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">10</property>
|
||||
<property name="value">1</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment4">
|
||||
<property name="lower">100</property>
|
||||
<property name="upper">1000</property>
|
||||
|
@ -195,7 +181,7 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Primary button</property>
|
||||
<property name="label" translatable="yes">Primary _button</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">right_handed_radio</property>
|
||||
</object>
|
||||
|
@ -326,44 +312,25 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_right">220</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">3</property>
|
||||
<property name="column_spacing">40</property>
|
||||
<property name="row_spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="acceleration_label">
|
||||
<object class="GtkLabel" id="pointer_speed_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Acceleration</property>
|
||||
<property name="label" translatable="yes">_Pointer speed</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="mnemonic_widget">acceleration_scale</property>
|
||||
<property name="mnemonic_widget">pointer_speed_scale</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="sensitivity_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Sensitivity</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="mnemonic_widget">sensitivity_scale</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
|
@ -371,7 +338,7 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="acceleration_slow_label">
|
||||
<object class="GtkLabel" id="pointer_speed_slow_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
|
@ -389,7 +356,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHScale" id="acceleration_scale">
|
||||
<object class="GtkHScale" id="pointer_speed_scale">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
|
@ -403,7 +370,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="acceleration_fast_label">
|
||||
<object class="GtkLabel" id="pointer_speed_fast_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
|
@ -427,69 +394,6 @@
|
|||
<property name="x_padding">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="sensitivity_low_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes" context="Mouse sensitivity" comments="low sensitivity">Low</property>
|
||||
<property name="justify">center</property>
|
||||
<attributes>
|
||||
<attribute name="scale" value="0.82999999999999996"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHScale" id="sensitivity_scale">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="adjustment">adjustment2</property>
|
||||
<property name="digits">0</property>
|
||||
<property name="draw_value">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="sensitivity_high_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes" context="Mouse sensitivity" comments="high sensitivity">High</property>
|
||||
<property name="justify">center</property>
|
||||
<attributes>
|
||||
<attribute name="scale" value="0.82999999999999996"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_padding">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -592,44 +496,25 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_right">220</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">3</property>
|
||||
<property name="column_spacing">40</property>
|
||||
<property name="row_spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="touchpad_acceleration_label">
|
||||
<object class="GtkLabel" id="touchpad_pointer_speed_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Acceleration</property>
|
||||
<property name="label" translatable="yes">_Pointer speed</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="mnemonic_widget">touchpad_acceleration_scale</property>
|
||||
<property name="mnemonic_widget">touchpad_pointer_speed_scale</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="touchpad_sensitivity_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Sensitivity</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="mnemonic_widget">touchpad_sensitivity_scale</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox7">
|
||||
<property name="visible">True</property>
|
||||
|
@ -637,7 +522,7 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="touchpad_acceleration_slow_label">
|
||||
<object class="GtkLabel" id="touchpad_pointer_speed_slow_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
|
@ -654,7 +539,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHScale" id="touchpad_acceleration_scale">
|
||||
<object class="GtkHScale" id="touchpad_pointer_speed_scale">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="adjustment">adjustment11</property>
|
||||
|
@ -668,7 +553,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="touchpad_acceleration_fast_label">
|
||||
<object class="GtkLabel" id="touchpad_pointer_speed_fast_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
|
@ -692,70 +577,6 @@
|
|||
<property name="x_padding">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="touchpad_sensitivity_low_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes" context="Mouse sensitivity" comments="low sensitivity">Low</property>
|
||||
<property name="justify">center</property>
|
||||
<attributes>
|
||||
<attribute name="scale" value="0.82999999999999996"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHScale" id="touchpad_sensitivity_scale">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="adjustment">adjustment22</property>
|
||||
<property name="digits">0</property>
|
||||
<property name="draw_value">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="touchpad_sensitivity_high_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes" context="Mouse sensitivity" comments="high sensitivity">High</property>
|
||||
<property name="justify">center</property>
|
||||
<attributes>
|
||||
<attribute name="scale" value="0.82999999999999996"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
<property name="x_padding">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
Loading…
Add table
Reference in a new issue