[gnome-tweak-tool] window: Only allow numbers in Hi-DPI entry box



commit 3c093f8e0fb4d0e44a9013fb567e9cf7aaab9cb6
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Tue Jun 20 22:31:12 2017 -0400

    window: Only allow numbers in Hi-DPI entry box

 gtweak/tweaks/tweak_group_windows.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_windows.py b/gtweak/tweaks/tweak_group_windows.py
index 0ac615e..e373500 100644
--- a/gtweak/tweaks/tweak_group_windows.py
+++ b/gtweak/tweaks/tweak_group_windows.py
@@ -239,11 +239,11 @@ class WindowScalingFactorTweak(Gtk.Box, Tweak):
         self._xsettings = XSettingsOverrides()
         self._original_factor = self._xsettings.get_window_scaling_factor()
 
-        adjustment = Gtk.Adjustment(lower=1, upper=2, step_increment=1, page_increment=1)
-        w = Gtk.SpinButton()
-        w.set_adjustment(adjustment)
+        w = Gtk.SpinButton.new_with_range(1, 2, 1)
+        w.set_numeric(True)
         w.set_digits(0)
-        adjustment.set_value(self._xsettings.get_window_scaling_factor())
+        w.set_update_policy(Gtk.SpinButtonUpdatePolicy.IF_VALID)
+        w.set_value(self._xsettings.get_window_scaling_factor())
         w.connect("value-changed", self._on_value_changed)
 
         build_label_beside_widget(self.name, w, hbox=self)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]