Tidy up Addon Manager project editor dialog

Set entry widgets to expand, align labels and adjust margins
and spacing.
This commit is contained in:
Nick Hall 2023-07-29 16:00:34 +01:00
parent d443017375
commit 57477b3da8

View File

@ -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)