Configuration screen: Fix alignmnents and margins

Credits to:
https://github.com/linuxmint/mintmenu/pull/222
https://github.com/linuxmint/mintmenu/pull/224
This commit is contained in:
Clement Lefebvre 2019-05-14 14:09:45 +01:00
parent c293d485d9
commit 7fa91f721e
3 changed files with 113 additions and 134 deletions

View File

@ -162,19 +162,14 @@ class KeybindingWidget(Gtk.Box):
__gsignals__ = {
'accel-edited': (GObject.SignalFlags.RUN_LAST, None, ()),
}
def __init__(self, desc):
def __init__(self):
super(KeybindingWidget, self).__init__()
self.desc = desc
self.label = Gtk.Label(desc)
if self.desc != "":
self.pack_start(self.label, False, False, 0)
self.button = Gtk.Button()
self.button.set_tooltip_text(_("Click to set a new accelerator key for opening and closing the menu. ") +
_("Press Escape or click again to cancel the operation. ") +
_("Press Backspace to clear the existing keybinding."))
self.button.connect("clicked", self.clicked)
self.button.set_size_request(200, -1)
self.pack_start(self.button, False, False, 4)
self.pack_start(self.button, True, True, 0)
self.show_all()
self.event_id = None

View File

@ -319,10 +319,7 @@
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="border_width">10</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
@ -385,14 +382,14 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="hbox4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">7</property>
<property name="spacing">6</property>
<child>
<object class="GtkFileChooserButton" id="button_icon_chooser">
<property name="visible">True</property>
@ -419,11 +416,20 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkLabel" id="keybinding_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Keyboard shortcut:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<placeholder/>
@ -447,38 +453,15 @@
<object class="GtkFrame" id="frame6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="border_width">10</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkBox" id="hbox11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkBox" id="vbox7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkCheckButton" id="startWithFavorites">
<property name="label" translatable="yes">Always start with favorites pane</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">start</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="showApplicationsPlugin">
<property name="label" translatable="yes">Show applications plugin</property>
@ -542,16 +525,6 @@
<property name="position">4</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
@ -575,18 +548,16 @@
<object class="GtkFrame" id="frame7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="border_width">10</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkGrid" id="table29">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">2</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">5</property>
<property name="column_spacing">10</property>
<child>
<object class="GtkLabel" id="headingColorLabel">
@ -708,18 +679,13 @@
<object class="GtkFrame" id="frame8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="border_width">10</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkGrid" id="table17">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="row_spacing">5</property>
<property name="column_spacing">10</property>
<child>
@ -928,10 +894,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="border_width">10</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
@ -1012,6 +975,21 @@
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="startWithFavorites">
<property name="label" translatable="yes">Always start with favorites pane</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">start</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">2</property>
</packing>
</child>
</object>
</child>
</object>
@ -1035,10 +1013,7 @@
<object class="GtkFrame" id="frame10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="border_width">10</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
@ -1046,6 +1021,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkGrid" id="table2">
<property name="visible">True</property>
@ -1144,7 +1120,10 @@
<object class="GtkBox" id="vbox4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="margin_top">10</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkCheckButton" id="computercheckbutton">
<property name="label" translatable="yes">Computer</property>
@ -1298,6 +1277,7 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<property name="layout_style">expand</property>
<child>
<object class="GtkButton" id="newButton">
<property name="label">gtk-new</property>
@ -1339,6 +1319,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="layout_style">expand</property>
<child>
<object class="GtkButton" id="upButton">
<property name="label">gtk-go-up</property>
@ -1380,6 +1361,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="layout_style">expand</property>
<child>
<object class="GtkButton" id="removeButton">
<property name="label">gtk-remove</property>
@ -1449,10 +1431,7 @@
<object class="GtkFrame" id="frame11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="border_width">10</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
@ -1460,6 +1439,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkGrid" id="table3">
<property name="visible">True</property>
@ -1558,7 +1538,10 @@
<object class="GtkBox" id="vbox6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="margin_top">10</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkCheckButton" id="softwaremanagercheckbutton">
<property name="label" translatable="yes">Software Manager</property>

View File

@ -64,9 +64,10 @@ class mintMenuConfig(object):
self.showButtonIcon = self.builder.get_object("showButtonIcon")
self.enableInternetSearch = self.builder.get_object("enableInternetSearch")
self.buttonText = self.builder.get_object("buttonText")
self.hotkeyWidget = keybinding.KeybindingWidget(_("Keyboard shortcut:"))
grid = self.builder.get_object("main_grid")
grid.attach(self.hotkeyWidget, 0, 2, 2, 1)
self.hotkeyWidget = keybinding.KeybindingWidget()
self.builder.get_object("main_grid").attach_next_to(self.hotkeyWidget,
self.builder.get_object("keybinding_label"),
Gtk.PositionType.RIGHT, 1, 1)
self.buttonIcon = self.builder.get_object("buttonIcon")
self.buttonIconChooser = self.builder.get_object("button_icon_chooser")
self.image_filter = Gtk.FileFilter()