Fix Gtk deprecation Widget.set_padding

This commit is contained in:
prculley 2019-09-13 16:11:53 -05:00 committed by Nick Hall
parent 702e51dd47
commit 831c7f9c66
4 changed files with 32 additions and 16 deletions

View File

@ -284,7 +284,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"information included in the error please remove "
"it."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@ -364,7 +365,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"remove anything that you would rather not have "
"included in the bug report."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@ -441,7 +443,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"can about what you were doing when the error "
"occurred."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@ -514,7 +517,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"that it does not contain anything that you do not "
"want to be sent to the developers."))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
swin = Gtk.ScrolledWindow()
@ -580,7 +584,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"clipboard and then open a webbrowser to file a bug report at "),
URL_BUGTRACKER))
label.set_halign(Gtk.Align.START)
label.set_padding(0, 4)
label.set_margin_top(4)
label.set_margin_bottom(4)
label.set_line_wrap(True)
label.set_use_markup(True)
@ -589,7 +594,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"and file a bug report on the Gramps bug "
"tracking system."))
url_label.set_halign(Gtk.Align.START)
url_label.set_padding(0, 4)
url_label.set_margin_top(4)
url_label.set_margin_bottom(4)
url_label.set_line_wrap(True)
url_label.set_size_request(200, -1)
@ -613,7 +619,8 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
"the button below, paste the report and click "
"submit report"))
clip_label.set_halign(Gtk.Align.START)
clip_label.set_padding(0, 4)
clip_label.set_margin_top(4)
clip_label.set_margin_bottom(4)
clip_label.set_line_wrap(True)
clip_label.set_size_request(200, -1)

View File

@ -283,7 +283,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_('_Person Filter') + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
label.set_use_underline(True)
label.set_mnemonic_widget(self.filter_obj)
box = Gtk.Box()
@ -301,7 +302,8 @@ class WriterOptionBox:
label_note = Gtk.Label(label=_('_Note Filter') + COLON)
label_note.set_halign(Gtk.Align.START)
label_note.set_size_request(120, -1)
label_note.set_padding(5, 0)
label_note.set_margin_start(5)
label_note.set_margin_end(5)
label_note.set_use_underline(True)
label_note.set_mnemonic_widget(self.filter_note)
box = Gtk.Box()
@ -317,7 +319,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_("Privacy Filter") + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
box.add(self.private_check)
@ -327,7 +330,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_("Living Filter") + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
self.restrict_option = Gtk.ComboBox()
@ -339,7 +343,8 @@ class WriterOptionBox:
label = Gtk.Label(label=_('Reference Filter') + COLON)
label.set_halign(Gtk.Align.START)
label.set_size_request(120, -1)
label.set_padding(5, 0)
label.set_margin_start(5)
label.set_margin_end(5)
box = Gtk.Box()
box.pack_start(label, False, True, 0)
box.pack_start(self.reference_filter, True, True, 0)

View File

@ -138,7 +138,10 @@ class LinkLabel(Gtk.EventBox):
self.connect('realize', realize_cb)
def set_padding(self, x, y):
self.label.set_padding(x, y)
self.label.set_margin_start(x)
self.label.set_margin_end(x)
self.label.set_margin_top(x)
self.label.set_margin_bottom(x)
def enter_text(self, obj, event, handle):
if self.emph:

View File

@ -1196,7 +1196,7 @@ class RelationshipView(NavigationView):
label = widgets.MarkupLabel(format % escape(title),
halign=Gtk.Align.END)
if self._config.get('preferences.releditbtn'):
label.set_padding(0, 5)
label.set_margin_end(5)
eventbox = Gtk.EventBox()
if handle is not None:
@ -1286,7 +1286,7 @@ class RelationshipView(NavigationView):
lbl = widgets.MarkupLabel(format % escape(title),
halign=Gtk.Align.END)
if self._config.get('preferences.releditbtn'):
lbl.set_padding(0, 5)
lbl.set_margin_end(5)
return lbl
def write_child(self, vbox, handle, index, child_should_be_linked):
@ -1333,6 +1333,7 @@ class RelationshipView(NavigationView):
link_label = widgets.LinkLabel(name, link_func, handle, emph,
theme=self.theme)
link_label.set_padding(3, 0)
if child_should_be_linked and self._config.get(
'preferences.releditbtn'):
button = widgets.IconButton(self.edit_button_press, handle)
@ -1354,7 +1355,7 @@ class RelationshipView(NavigationView):
value = self.info_string(handle)
if value:
l = widgets.MarkupLabel(value)
l.set_padding(48, 0)
l.set_margin_start(48)
vbox.add(l)
def write_data(self, box, title, start_col=_SDATA_START,