Commit ea0ccb7b authored by Nishal Kulkarni's avatar Nishal Kulkarni
Browse files

universal-access: Allow setting custom magnification step

Currently the step for incrementing or decrementing magnification
is decided internally, it's better if we allow user to set
the magnification step factor.

We expose another setting in zoom settings called
`magnifier_step_factor_spin` Uses mag-step-factor gsetting.
Depends on gnome-settings-daemon!269 and gsettings-desktop-schemas!52 being merged first.

Related to: gnome-settings-daemon#458
parent 41c613f4
Pipeline #326765 passed with stages
in 4 minutes and 33 seconds
......@@ -44,6 +44,7 @@ struct _CcZoomOptionsDialog
GtkWidget *contrast_slider;
GtkWidget *crosshair_picker_color_button;
GtkWidget *magnifier_factor_spin;
GtkWidget *magnifier_step_factor_spin;
GtkWidget *seeing_zoom_switch;
GtkWidget *crosshair_thickness_scale;
GtkWidget *grayscale_slider;
......@@ -413,6 +414,11 @@ cc_zoom_options_dialog_constructed (GObject *object)
gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (self->magnifier_factor_spin)),
"value", G_SETTINGS_BIND_DEFAULT);
/* Magnification Step factor */
g_settings_bind (self->settings, "mag-step-factor",
gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (self->magnifier_step_factor_spin)),
"value", G_SETTINGS_BIND_DEFAULT);
/* Screen position combo */
screen_position_notify_cb (self, "screen-position");
g_signal_connect_object (self->settings, "changed::screen-position",
......@@ -523,6 +529,7 @@ cc_zoom_options_dialog_class_init (CcZoomOptionsDialogClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcZoomOptionsDialog, grayscale_slider);
gtk_widget_class_bind_template_child (widget_class, CcZoomOptionsDialog, inverse_enabled_switch);
gtk_widget_class_bind_template_child (widget_class, CcZoomOptionsDialog, magnifier_factor_spin);
gtk_widget_class_bind_template_child (widget_class, CcZoomOptionsDialog, magnifier_step_factor_spin);
gtk_widget_class_bind_template_child (widget_class, CcZoomOptionsDialog, proportional_radio);
gtk_widget_class_bind_template_child (widget_class, CcZoomOptionsDialog, push_radio);
gtk_widget_class_bind_template_child (widget_class, CcZoomOptionsDialog, screen_part_radio);
......
......@@ -25,6 +25,13 @@
<property name="value">2</property>
<property name="step_increment">0.25</property>
<property name="page_increment">1</property>
</object>
<object class="GtkAdjustment" id="magnifier_step_factor_adjustment">
<property name="lower">0.1</property>
<property name="upper">1.0</property>
<property name="value">0.25</property>
<property name="step_increment">0.05</property>
<property name="page_increment">0.25</property>
</object>
<object class="GtkListStore" id="screen_position_model">
<columns>
......@@ -174,6 +181,52 @@
</child>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<property name="margin-start">4</property>
<child>
<placeholder/>
</child>
<child type="label">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="ypad">2</property>
<property name="label" translatable="yes">Magnification _Step:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">magnifier_step_factor_spin</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.25"/>
</attributes>
</object>
</child>
<child>
<object class="GtkSpinButton" id="magnifier_step_factor_spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
<property name="adjustment">magnifier_step_factor_adjustment</property>
<property name="digits">2</property>
<property name="hexpand">True</property>
<property name="margin-start">21</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment