def __init__(self, **options): name = _("Placement") Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL, spacing=0) _GSettingsTweak.__init__(self, name, "org.gnome.desktop.wm.preferences", "button-layout", **options) box_btn = Gtk.ButtonBox() box_btn.set_layout(Gtk.ButtonBoxStyle.EXPAND) # Translators: For RTL languages, this is the "Right" direction since the # interface is flipped btn1 = Gtk.RadioButton.new_with_label_from_widget(None, _("Left")) btn1.set_property("draw-indicator", False) btn2 = Gtk.RadioButton.new_from_widget(btn1) # Translators: For RTL languages, this is the "Left" direction since the # interface is flipped btn2.set_label(_("Right")) btn2.set_property("draw-indicator", False) val = self.settings.get_string(self.key_name) (left, colon, right) = val.partition(":") if "close" in right: btn2.set_active(True) btn2.connect("toggled", self.on_button_toggled) box_btn.pack_start(btn1, True, True, 0) box_btn.pack_start(btn2, True, True, 0) build_label_beside_widget(name, box_btn, hbox=self)
def __init__(self, **options): name = _("Overview Shortcut") Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL, spacing=0) _GSettingsTweak.__init__(self, name, "org.gnome.mutter", "overlay-key", loaded=_shell_loaded, **options) box_btn = Gtk.ButtonBox() box_btn.set_layout(Gtk.ButtonBoxStyle.EXPAND) btn1 = Gtk.RadioButton.new_with_label_from_widget( None, _("Left Super")) btn1.set_property("draw-indicator", False) btn2 = Gtk.RadioButton.new_from_widget(btn1) btn2.set_label(_("Right Super")) btn2.set_property("draw-indicator", False) if (self.settings.get_string(self.key_name) == "Super_R"): btn2.set_active(True) btn1.connect("toggled", self.on_button_toggled, "Super_L") btn2.connect("toggled", self.on_button_toggled, "Super_R") box_btn.pack_start(btn1, True, True, 0) box_btn.pack_start(btn2, True, True, 0) build_label_beside_widget(name, box_btn, hbox=self)
def __init__(self, **options): self._xsettings = XSettingsOverrides() name = _("Application Menu") GetterSetterSwitchTweak.__init__(self, name, **options) _GSettingsTweak.__init__(self, name, "org.gnome.desktop.wm.preferences", "button-layout", loaded=_shell_loaded, **options)
def __init__(self, **options): name = _("Workspace Creation") Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL) _GSettingsTweak.__init__(self, name, "org.gnome.mutter", "dynamic-workspaces", **options) default = self.STATUS.keys()[self.STATUS.values().index(self.settings[self.key_name])] key_options = [("dynamic", _("Dynamic")), ("static", _("Static"))] self.combo = build_combo_box_text(default, *key_options) self.combo.connect('changed', self._on_combo_changed) build_label_beside_widget(name, self.combo, hbox=self) self.widget_for_size_group = self.combo
def __init__(self, **options): name = _("Compose Key") Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL, spacing=18) _GSettingsTweak.__init__(self, name, "org.gnome.desktop.input-sources", "xkb-options", **options) key_values = [ "compose:sclk", "compose:prsc", "compose:menu", "compose:ralt", "compose:rctrl", "compose:rwin", "compose:caps", "compose:lctrl" ] key_names = [ _("Scroll Lock"), _("PrtScn"), _("Menu"), _("Right Alt"), _("Right Ctrl"), _("Right Super"), _("Caps Lock"), _("Left Ctrl") ] button = Gtk.Button(_("Disabled"), halign=Gtk.Align.END) button.set_relief(Gtk.ReliefStyle.NONE) button.connect("clicked", self.on_button_clicked, self.settings) desc = _("Allows entering additional characters.") vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) vbox.props.spacing = UI_BOX_SPACING lbl = Gtk.Label(name) lbl.props.xalign = 0.0 lbl_desc = Gtk.Label() lbl_desc.set_line_wrap(True) lbl_desc.get_style_context().add_class("dim-label") lbl_desc.set_markup("<span size='small'>" + GLib.markup_escape_text(desc) + "</span>") vbox.pack_start(lbl, False, False, 0) vbox.pack_start(lbl_desc, False, False, 0) self.pack_start(vbox, False, False, 0) self.pack_end(button, True, True, 0) for index, item in enumerate(key_values): if self.settings.setting_is_in_list("xkb-options", item): button.set_label(key_names[index]) # We only support one Compose key so drop any one other set keys for extra in key_values: self.settings.setting_remove_from_list( "xkb-options", extra) self.settings.setting_add_to_list("xkb-options", item)
def __init__(self, **options): name = _("Dynamic Workspaces") Gtk.ListBox.__init__(self) _GSettingsTweak.__init__(self, name, "org.gnome.mutter", "dynamic-workspaces", loaded=_shell_loaded) self.set_selection_mode(Gtk.SelectionMode.NONE) # Needs other page elements to get margins too # self.props.margin_left = 50 # self.props.margin_right = 50 row = Gtk.ListBoxRow() hbox = Gtk.Box() hbox.props.margin = 10 row.add(hbox) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) lbl = Gtk.Label(name, xalign=0) lbl.props.xalign = 0.0 desc = _( "Workspaces can be created on demand, and are automatically removed when empty." ) lbl_desc = Gtk.Label() lbl_desc.set_line_wrap(True) lbl_desc.get_style_context().add_class("dim-label") lbl_desc.set_markup("<span size='small'>" + GLib.markup_escape_text(desc) + "</span>") self.check1 = Gtk.Image.new_from_icon_name("object-select-symbolic", Gtk.IconSize.SMALL_TOOLBAR) self.check1.set_no_show_all(True) self.check1.set_visible(self.settings[self.key_name]) vbox.pack_start(lbl, False, False, 0) vbox.pack_start(lbl_desc, False, False, 0) hbox.pack_start(vbox, False, False, 0) hbox.pack_end(self.check1, False, False, 0) self.add(row) row = Gtk.ListBoxRow() hbox = Gtk.Box() hbox.props.margin = 10 row.add(hbox) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) lbl = Gtk.Label(_("Static Workspaces"), xalign=0) lbl.props.xalign = 0.0 desc = _("Number of workspaces is fixed.") lbl_desc = Gtk.Label() lbl_desc.set_line_wrap(True) lbl_desc.get_style_context().add_class("dim-label") lbl_desc.set_markup("<span size='small'>" + GLib.markup_escape_text(desc) + "</span>") self.check2 = Gtk.Image.new_from_icon_name("object-select-symbolic", Gtk.IconSize.SMALL_TOOLBAR) self.check2.set_no_show_all(True) self.check2.set_visible(not self.settings[self.key_name]) vbox.pack_start(lbl, False, False, 0) vbox.pack_start(lbl_desc, False, False, 0) hbox.pack_start(vbox, False, False, 0) hbox.pack_end(self.check2, False, False, 0) self.add(row) self.connect('row-activated', self.on_row_clicked)
def __init__(self, **options): name = _("Workspaces") Gtk.ListBox.__init__(self) Tweak.__init__( self, _("Display Handling"), _("Workspaces span displays"), loaded=_shell_loaded, ) _GSettingsTweak.__init__(self, name, "org.gnome.mutter", "workspaces-only-on-primary", loaded=_shell_loaded) self.set_selection_mode(Gtk.SelectionMode.NONE) # Needs other page elements to get margins too # self.props.margin_left = 50 # self.props.margin_right = 50 row = Gtk.ListBoxRow() hbox = Gtk.Box() hbox.props.margin = 10 row.add(hbox) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) lbl = Gtk.Label(_("Workspaces on primary display only"), xalign=0) lbl.props.xalign = 0.0 desc = _("Additional displays are treated as independent workspaces.") lbl_desc = Gtk.Label() lbl_desc.set_line_wrap(True) lbl_desc.get_style_context().add_class("dim-label") lbl_desc.set_markup("<span size='small'>" + GLib.markup_escape_text(desc) + "</span>") self.check1 = Gtk.Image.new_from_icon_name("object-select-symbolic", Gtk.IconSize.SMALL_TOOLBAR) self.check1.set_no_show_all(True) self.check1.set_visible(self.settings[self.key_name]) vbox.pack_start(lbl, False, False, 0) vbox.pack_start(lbl_desc, False, False, 0) hbox.pack_start(vbox, False, False, 0) hbox.pack_end(self.check1, False, False, 0) self.add(row) row = Gtk.ListBoxRow() hbox = Gtk.Box() hbox.props.margin = 10 row.add(hbox) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) lbl = Gtk.Label(_("Workspaces span displays"), xalign=0) lbl.props.xalign = 0.0 desc = _("The current workspace includes additional displays.") lbl_desc = Gtk.Label() lbl_desc.set_line_wrap(True) lbl_desc.get_style_context().add_class("dim-label") lbl_desc.set_markup("<span size='small'>" + GLib.markup_escape_text(desc) + "</span>") self.check2 = Gtk.Image.new_from_icon_name("object-select-symbolic", Gtk.IconSize.SMALL_TOOLBAR) self.check2.set_no_show_all(True) self.check2.set_visible(not self.settings[self.key_name]) vbox.pack_start(lbl, False, False, 0) vbox.pack_start(lbl_desc, False, False, 0) hbox.pack_start(vbox, False, False, 0) hbox.pack_end(self.check2, False, False, 0) self.add(row) self.connect('row-activated', self.on_row_clicked)