Commit 89c320bb authored by Robin Stocker's avatar Robin Stocker Committed by John Stowers

Change widget for text-scaling-factor to SpinButton

https://bugzilla.gnome.org/show_bug.cgi?id=650660

Conflicts:

	gtweak/tweaks/tweak_font.py
parent 485e5743
......@@ -18,10 +18,10 @@
from gi.repository import Gtk
from gtweak.tweakmodel import Tweak, TWEAK_GROUP_FONTS
from gtweak.widgets import GSettingsRangeTweak, GSettingsFontButtonTweak, GSettingsComboTweak
from gtweak.widgets import GSettingsSpinButtonTweak, GSettingsFontButtonTweak, GSettingsComboTweak
TWEAKS = (
GSettingsRangeTweak("org.gnome.desktop.interface", "text-scaling-factor", adjustment_step=0.1, group_name=TWEAK_GROUP_FONTS),
GSettingsSpinButtonTweak("org.gnome.desktop.interface", "text-scaling-factor", adjustment_step=0.1, digits=1, group_name=TWEAK_GROUP_FONTS),
GSettingsFontButtonTweak("org.gnome.desktop.interface", "font-name", group_name=TWEAK_GROUP_FONTS),
GSettingsFontButtonTweak("org.gnome.desktop.interface", "document-font-name", group_name=TWEAK_GROUP_FONTS),
GSettingsFontButtonTweak("org.gnome.desktop.interface", "monospace-font-name", group_name=TWEAK_GROUP_FONTS),
......
......@@ -134,6 +134,21 @@ class GSettingsRangeTweak(_GSettingsTweak):
self.widget = build_label_beside_widget(self.settings.schema_get_summary(key_name), w)
self.widget_for_size_group = w
class GSettingsSpinButtonTweak(_GSettingsTweak):
def __init__(self, schema_name, key_name, **options):
_GSettingsTweak.__init__(self, schema_name, key_name, **options)
#returned variant is range:(min, max)
_min, _max = self.settings.get_range(key_name)[1]
adjustment = Gtk.Adjustment(0, _min, _max, options.get('adjustment_step', 1))
w = Gtk.SpinButton()
w.set_adjustment(adjustment)
w.set_digits(options.get('digits', 0))
self.settings.bind(key_name, adjustment, "value", Gio.SettingsBindFlags.DEFAULT)
self.widget = build_label_beside_widget(self.settings.schema_get_summary(key_name), w)
self.widget_for_size_group = w
class GSettingsComboEnumTweak(_GSettingsTweak):
def __init__(self, schema_name, key_name, **options):
_GSettingsTweak.__init__(self, schema_name, key_name, **options)
......
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