From 57477b3da86af0b80bd5c831e5d8d78ba2c8d9f7 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sat, 29 Jul 2023 16:00:34 +0100 Subject: [PATCH] Tidy up Addon Manager project editor dialog Set entry widgets to expand, align labels and adjust margins and spacing. --- gramps/gui/plug/_windows.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/gramps/gui/plug/_windows.py b/gramps/gui/plug/_windows.py index d5aec9cc0..cbe437da3 100644 --- a/gramps/gui/plug/_windows.py +++ b/gramps/gui/plug/_windows.py @@ -687,25 +687,29 @@ class AddonManager(ManagedWindow): title = _('New Project') else: title = _('Edit Project') - dialog = Gtk.Dialog(title=title, - transient_for=self.window) - dialog.set_border_width(12) - dialog.vbox.set_spacing(10) - hbox = Gtk.Box() + dialog = Gtk.Dialog(title=title, transient_for=self.window) + dialog.set_border_width(6) + dialog.vbox.set_spacing(6) + + grid = Gtk.Grid() + grid.set_row_spacing(6) + grid.set_column_spacing(6) label = Gtk.Label(label=_("%s: ") % _('Project name')) - hbox.pack_start(label, True, True, 0) + label.set_halign(Gtk.Align.END) + grid.attach(label, 0, 0, 1, 1) name = Gtk.Entry() + name.set_hexpand(True) name.set_text(row.project[0]) name.set_activates_default(True) - hbox.pack_start(name, False, True, 0) - dialog.vbox.pack_start(hbox, False, True, 0) - hbox = Gtk.Box() + grid.attach(name, 1, 0, 1, 1) label = Gtk.Label(label=_("%s: ") % _('Url')) - hbox.pack_start(label, True, True, 0) + label.set_halign(Gtk.Align.END) + grid.attach(label, 0, 1, 1, 1) url = Gtk.Entry() + url.set_hexpand(True) url.set_text(row.project[1]) - hbox.pack_start(url, False, True, 0) - dialog.vbox.pack_start(hbox, False, True, 0) + grid.attach(url, 1, 1, 1, 1) + dialog.vbox.pack_start(grid, True, True, 0) dialog.add_buttons(_('_Cancel'), Gtk.ResponseType.CANCEL, _('_OK'), Gtk.ResponseType.OK)