[gnome-tweak-tool] Fix typing options packing
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] Fix typing options packing
- Date: Wed, 21 Aug 2013 13:31:11 +0000 (UTC)
commit d6e885e78aeb26bdf547eb7d1e927b2f4b88517d
Author: John Stowers <john stowers gmail com>
Date: Mon Aug 19 23:43:56 2013 +0200
Fix typing options packing
gtweak/tweakmodel.py | 1 -
gtweak/tweaks/tweak_group_keymouse.py | 4 ++++
gtweak/tweaks/tweak_group_legacy.py | 21 ++++++++-------------
3 files changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/gtweak/tweakmodel.py b/gtweak/tweakmodel.py
index 78d746b..b43decd 100644
--- a/gtweak/tweakmodel.py
+++ b/gtweak/tweakmodel.py
@@ -35,7 +35,6 @@ TWEAK_GROUP_WINDOWS = _("Windows")
TWEAK_GROUP_WORKSPACES = _("Workspaces")
TWEAK_GROUP_MOUSE = _("Mouse")
-TWEAK_GROUP_TYPING = _("Typing")
TWEAK_GROUP_FILES = _("Files")
LOG = logging.getLogger(__name__)
diff --git a/gtweak/tweaks/tweak_group_keymouse.py b/gtweak/tweaks/tweak_group_keymouse.py
index 08cadcc..ab4df6d 100644
--- a/gtweak/tweaks/tweak_group_keymouse.py
+++ b/gtweak/tweaks/tweak_group_keymouse.py
@@ -58,6 +58,10 @@ class KeyThemeSwitcher(GSettingsComboTweak):
TWEAK_GROUPS = [
ListBoxTweakGroup(_("Keyboard and Mouse"),
KeyThemeSwitcher(),
+ GSettingsSwitchTweak(_("Show All Input Sources"),
+ "org.gnome.desktop.input-sources",
+ "show-all-sources",
+ logout_required=True,),
Title(_("Mouse"), ""),
GSettingsSwitchTweak(_("Show location of pointer"),
"org.gnome.settings-daemon.peripherals.mouse",
diff --git a/gtweak/tweaks/tweak_group_legacy.py b/gtweak/tweaks/tweak_group_legacy.py
index 57cd6ad..187eaa0 100644
--- a/gtweak/tweaks/tweak_group_legacy.py
+++ b/gtweak/tweaks/tweak_group_legacy.py
@@ -21,7 +21,7 @@ import logging
from gi.repository import Pango, Gtk, GnomeDesktop
from gtweak.gshellwrapper import GnomeShellFactory
-from gtweak.tweakmodel import Tweak, TweakGroup, TWEAK_GROUP_TYPING
+from gtweak.tweakmodel import Tweak, TweakGroup
from gtweak.widgets import GSettingsSwitchTweak, build_label_beside_widget, GSettingsComboEnumTweak,
GSettingsComboTweak, build_horizontal_sizegroup, ListBoxTweakGroup, Title
from gtweak.gsettings import GSettingsSetting, GSettingsMissingError, GSettingsFakeSetting
@@ -57,13 +57,13 @@ class _XkbOption(Gtk.Box, Tweak):
self._combo = Gtk.ComboBox(model = store)
renderer = Gtk.CellRendererText()
renderer.props.ellipsize = Pango.EllipsizeMode.END
- renderer.props.max_width_chars = 40
+ renderer.props.max_width_chars = 30
self._combo.pack_start(renderer, True)
self._combo.add_attribute(renderer, "text", 1)
self._combo_changed_handler_id = self._combo.connect("changed", self._on_combo_changed)
build_label_beside_widget(self.name, self._combo, hbox=self)
- self.widget_for_size_group = self._combo
+ self.widget_for_size_group = None
self.reload()
@@ -105,10 +105,10 @@ class TypingTweakGroup(Gtk.Box, TweakGroup):
XKB_OPTIONS_BLACKLIST = {"lv3","Compose key"}
def __init__(self):
- Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
+ Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL, spacing=3)
self._option_objects = []
+ self._sg = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
ok = False
- self.widget_for_size_group = None
try:
self._kbdsettings = GSettingsSetting(self.XKB_GSETTINGS_SCHEMA)
self._kbdsettings.connect("changed::"+self.XKB_GSETTINGS_NAME, self._on_changed)
@@ -125,20 +125,15 @@ class TypingTweakGroup(Gtk.Box, TweakGroup):
if ok:
for opt in set(self._xkb_info.get_all_option_groups()) - self.XKB_OPTIONS_BLACKLIST:
obj = _XkbOption(opt, self._kbdsettings, self._xkb_info)
+ self._sg.add_widget(obj._combo)
self._option_objects.append(obj)
self.pack_start(obj, False, False, 0)
- TweakGroup.__init__(self, TWEAK_GROUP_TYPING, *self._option_objects)
+ TweakGroup.__init__(self, _("Typing"), *self._option_objects)
def _on_changed(self, *args):
for obj in self._option_objects:
obj.reload()
TWEAK_GROUPS = [
- ListBoxTweakGroup(TWEAK_GROUP_TYPING,
- GSettingsSwitchTweak(_("Show All Sources"),
- "org.gnome.desktop.input-sources",
- "show-all-sources",
- logout_required=True,),
- TypingTweakGroup(),
- ),
+ TypingTweakGroup(),
]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]