diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index 58be41eb9..75d6b8232 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -312,7 +312,7 @@ class ConfigureDialog(ManagedWindow): config = self.__config text = Gtk.Label() text.set_line_wrap(line_wrap) - text.set_alignment(0.,0.) + text.set_halign(Gtk.Align.START) text.set_text(label) grid.attach(text, 1, index, 8, 1) diff --git a/gramps/gui/editors/filtereditor.py b/gramps/gui/editors/filtereditor.py index d7e172eb3..bb61a4e33 100644 --- a/gramps/gui/editors/filtereditor.py +++ b/gramps/gui/editors/filtereditor.py @@ -488,8 +488,7 @@ class EditRule(ManagedWindow): vallist = [] tlist = [] pos = 0 - l2 = Gtk.Label(label=class_obj.name) - l2.set_alignment(0, 0.5) + l2 = Gtk.Label(label=class_obj.name, halign=Gtk.Align.START) l2.show() c = Gtk.TreeView() #c.set_data('d', pos) @@ -501,8 +500,7 @@ class EditRule(ManagedWindow): grid.set_row_spacing(6) grid.show() for v in arglist: - l = Gtk.Label(label=v) - l.set_alignment(1, 0.5) + l = Gtk.Label(label=v, halign=Gtk.Align.END) l.show() if v == _('Place:'): t = MyPlaces([]) diff --git a/gramps/gui/filters/sidebar/_sidebarfilter.py b/gramps/gui/filters/sidebar/_sidebarfilter.py index e6ba40c70..a6d3b0ad0 100644 --- a/gramps/gui/filters/sidebar/_sidebarfilter.py +++ b/gramps/gui/filters/sidebar/_sidebarfilter.py @@ -135,7 +135,7 @@ class SidebarFilter(DbGUIElement): label = Gtk.Label() label.set_text('%s' % heading) label.set_use_markup(True) - label.set_alignment(0, 0.5) + label.set_halign(Gtk.Align.START) self.grid.attach(label, 1, self.position, 1, 1) self.position += 1 diff --git a/gramps/gui/logger/_errorreportassistant.py b/gramps/gui/logger/_errorreportassistant.py index d032e306f..668f83413 100644 --- a/gramps/gui/logger/_errorreportassistant.py +++ b/gramps/gui/logger/_errorreportassistant.py @@ -260,7 +260,7 @@ class ErrorReportAssistant(Gtk.Assistant): label = Gtk.Label(label=_("If you can see that there is any personal " "information included in the error please remove " "it.")) - label.set_alignment(0.01, 0.5) + label.set_halign(Gtk.Align.START) label.set_padding(0, 4) label.set_line_wrap(True) @@ -339,7 +339,7 @@ class ErrorReportAssistant(Gtk.Assistant): "anything that you know to be wrong or remove " "anything that you would rather not have included " "in the bug report.")) - label.set_alignment(0.01, 0.5) + label.set_halign(Gtk.Align.START) label.set_padding(0, 4) label.set_line_wrap(True) @@ -416,7 +416,7 @@ class ErrorReportAssistant(Gtk.Assistant): label = Gtk.Label(label=_("Please provide as much information as you can " "about what you were doing when the error " "occured.")) - label.set_alignment(0.01, 0.5) + label.set_halign(Gtk.Align.START) label.set_padding(0, 4) label.set_line_wrap(True) @@ -489,7 +489,7 @@ class ErrorReportAssistant(Gtk.Assistant): "of the error information. Just make sure that it " "does not contain anything that you do not want " "to be sent to the developers.")) - label.set_alignment(0.01, 0.5) + label.set_halign(Gtk.Align.START) label.set_padding(0, 4) label.set_line_wrap(True) @@ -555,7 +555,7 @@ class ErrorReportAssistant(Gtk.Assistant): (_("Use the two buttons below to first copy the bug report to the " "clipboard and then open a webbrowser to file a bug report at "), URL_BUGTRACKER)) - label.set_alignment(0.01, 0.5) + label.set_halign(Gtk.Align.START) label.set_padding(0, 4) label.set_line_wrap(True) label.set_use_markup(True) @@ -564,7 +564,7 @@ class ErrorReportAssistant(Gtk.Assistant): url_label = Gtk.Label(label=_("Use this button to start a web browser and " "file a bug report on the Gramps bug tracking " "system.")) - url_label.set_alignment(0.01, 0.5) + url_label.set_halign(Gtk.Align.START) url_label.set_padding(0, 4) url_label.set_line_wrap(True) url_label.set_size_request(200, -1) @@ -588,7 +588,7 @@ class ErrorReportAssistant(Gtk.Assistant): "Then go to the bug tracking website by using " "the button below, paste the report and click " "submit report")) - clip_label.set_alignment(0.01, 0.5) + clip_label.set_halign(Gtk.Align.START) clip_label.set_padding(0, 4) clip_label.set_line_wrap(True) clip_label.set_size_request(200, -1) diff --git a/gramps/gui/plug/_guioptions.py b/gramps/gui/plug/_guioptions.py index 155c22639..119303ed2 100644 --- a/gramps/gui/plug/_guioptions.py +++ b/gramps/gui/plug/_guioptions.py @@ -617,7 +617,7 @@ class GuiPersonOption(Gtk.Box): self.__uistate = uistate self.__track = track self.__person_label = Gtk.Label() - self.__person_label.set_alignment(0.0, 0.5) + self.__person_label.set_halign(Gtk.Align.START) pevt = Gtk.EventBox() pevt.add(self.__person_label) @@ -742,7 +742,7 @@ class GuiFamilyOption(Gtk.Box): self.__uistate = uistate self.__track = track self.__family_label = Gtk.Label() - self.__family_label.set_alignment(0.0, 0.5) + self.__family_label.set_halign(Gtk.Align.START) pevt = Gtk.EventBox() pevt.add(self.__family_label) @@ -931,7 +931,7 @@ class GuiNoteOption(Gtk.Box): self.__uistate = uistate self.__track = track self.__note_label = Gtk.Label() - self.__note_label.set_alignment(0.0, 0.5) + self.__note_label.set_halign(Gtk.Align.START) pevt = Gtk.EventBox() pevt.add(self.__note_label) @@ -1035,7 +1035,7 @@ class GuiMediaOption(Gtk.Box): self.__uistate = uistate self.__track = track self.__media_label = Gtk.Label() - self.__media_label.set_alignment(0.0, 0.5) + self.__media_label.set_halign(Gtk.Align.START) pevt = Gtk.EventBox() pevt.add(self.__media_label) diff --git a/gramps/gui/plug/_windows.py b/gramps/gui/plug/_windows.py index 9cc67e7e5..085d96b13 100644 --- a/gramps/gui/plug/_windows.py +++ b/gramps/gui/plug/_windows.py @@ -1003,7 +1003,7 @@ class ToolManagedWindowBase(ManagedWindow): widget.set_hexpand(True) if text: text_widget = Gtk.Label(label='%s:' % text) - text_widget.set_alignment(0.0, 0.5) + text_widget.set_halign(Gtk.Align.START) grid.attach(text_widget, 1, row, 1, 1) grid.attach(widget, 2, row, 1, 1) else: diff --git a/gramps/gui/plug/export/_exportoptions.py b/gramps/gui/plug/export/_exportoptions.py index f985430b2..241f7d569 100644 --- a/gramps/gui/plug/export/_exportoptions.py +++ b/gramps/gui/plug/export/_exportoptions.py @@ -263,7 +263,7 @@ class WriterOptionBox(object): # Frame Person: self.filter_obj = Gtk.ComboBox() label = Gtk.Label(label=_('_Person Filter') + ": ") - label.set_alignment(0, 0.5) + label.set_halign(Gtk.Align.START) label.set_size_request(150, -1) label.set_use_underline(True) label.set_mnemonic_widget(self.filter_obj) @@ -280,7 +280,7 @@ class WriterOptionBox(object): # Objects for choosing a Note filter: self.filter_note = Gtk.ComboBox() label_note = Gtk.Label(label=_('_Note Filter') + ": ") - label_note.set_alignment(0, 0.5) + label_note.set_halign(Gtk.Align.START) label_note.set_size_request(150, -1) label_note.set_use_underline(True) label_note.set_mnemonic_widget(self.filter_note) @@ -295,7 +295,7 @@ class WriterOptionBox(object): elif proxy_name == "privacy": # Frame 3: label = Gtk.Label(label=_("Privacy Filter") + ":") - label.set_alignment(0, 0.5) + label.set_halign(Gtk.Align.START) label.set_size_request(150, -1) box = Gtk.Box() box.pack_start(label, False, True, 0) @@ -304,7 +304,7 @@ class WriterOptionBox(object): elif proxy_name == "living": # Frame 4: label = Gtk.Label(label=_("Living Filter") + ":") - label.set_alignment(0, 0.5) + label.set_halign(Gtk.Align.START) label.set_size_request(150, -1) box = Gtk.Box() box.pack_start(label, False, True, 0) @@ -315,7 +315,7 @@ class WriterOptionBox(object): # Frame 5: self.reference_filter = Gtk.ComboBox() label = Gtk.Label(label=_('Reference Filter') + ": ") - label.set_alignment(0, 0.5) + label.set_halign(Gtk.Align.START) label.set_size_request(150, -1) box = Gtk.Box() box.pack_start(label, False, True, 0) diff --git a/gramps/gui/plug/report/_docreportdialog.py b/gramps/gui/plug/report/_docreportdialog.py index 8b85ec16e..02e3aaaad 100644 --- a/gramps/gui/plug/report/_docreportdialog.py +++ b/gramps/gui/plug/report/_docreportdialog.py @@ -168,7 +168,7 @@ class DocReportDialog(ReportDialog): self.make_doc_menu(self.options.handler.get_format_name()) self.format_menu.connect('changed', self.doc_type_changed) label = Gtk.Label(label="%s:" % _("Output Format")) - label.set_alignment(0.0, 0.5) + label.set_set_halign(Gtk.Align.START) self.grid.attach(label, 1, self.row, 1, 1) self.format_menu.set_hexpand(True) self.grid.attach(self.format_menu, 2, self.row, 2, 1) @@ -214,7 +214,7 @@ class DocReportDialog(ReportDialog): self.html_grid.set_border_width(6) label = Gtk.Label(label="%s:" % _("CSS file")) - label.set_alignment(0.0,0.5) + label.set_set_halign(Gtk.Align.START) self.html_grid.attach(label, 1, 1, 1, 1) self.css_combo = Gtk.ComboBoxText() diff --git a/gramps/gui/plug/report/_graphvizreportdialog.py b/gramps/gui/plug/report/_graphvizreportdialog.py index 8361c0647..0adbb158c 100644 --- a/gramps/gui/plug/report/_graphvizreportdialog.py +++ b/gramps/gui/plug/report/_graphvizreportdialog.py @@ -148,7 +148,7 @@ class GraphvizReportDialog(ReportDialog): self.format_menu.set(self.options.handler.get_format_name()) self.format_menu.connect('changed', self.doc_type_changed) label = Gtk.Label(label="%s:" % _("Output Format")) - label.set_alignment(0.0, 0.5) + label.set_halign(Gtk.Align.START) self.grid.attach(label, 1, self.row, 1, 1) self.format_menu.set_hexpand(True) self.grid.attach(self.format_menu, 2, self.row, 2, 1) diff --git a/gramps/gui/plug/report/_reportdialog.py b/gramps/gui/plug/report/_reportdialog.py index 1935d4c9c..143cac23b 100644 --- a/gramps/gui/plug/report/_reportdialog.py +++ b/gramps/gui/plug/report/_reportdialog.py @@ -318,7 +318,7 @@ class ReportDialog(ManagedWindow): # Styles Frame label = Gtk.Label(label="%s:" % _("Style")) - label.set_alignment(0.0, 0.5) + label.set_halign(Gtk.Align.START) self.style_menu = StyleComboBox() self.style_menu.set_hexpand(True) @@ -361,7 +361,7 @@ class ReportDialog(ManagedWindow): grid.set_row_spacing(6) label = Gtk.Label(label="%s" % _("Report Options")) - label.set_alignment(0.0, 0.5) + label.set_halign(Gtk.Align.START) label.set_use_markup(True) self.notebook.append_page(grid, label) @@ -371,7 +371,7 @@ class ReportDialog(ManagedWindow): widget.set_hexpand(True) if text: text_widget = Gtk.Label(label="%s:" % text) - text_widget.set_alignment(0.0, 0.0) + text_widget.set_halign(Gtk.Align.START) grid.attach(text_widget, 1, row, 1, 1) grid.attach(widget, 2, row, 1, 1) else: @@ -395,7 +395,7 @@ class ReportDialog(ManagedWindow): widget.set_hexpand(True) if text: text_widget = Gtk.Label(label='%s:' % text) - text_widget.set_alignment(0.0, 0.5) + text_widget.set_halign(Gtk.Align.START) grid.attach(text_widget, 1, row, 1, 1) if isinstance(widget, GuiTextOption): grid.attach(widget, 2, row, 1, 1) @@ -451,7 +451,7 @@ class ReportDialog(ManagedWindow): # need any labels at top: label = Gtk.Label(label="%s" % _('Document Options')) label.set_use_markup(1) - label.set_alignment(0.0, 0.5) + label.set_halign(Gtk.Align.START) self.grid.set_border_width(12) self.grid.attach(label, 0, self.row, 4, 1) self.row += 1 @@ -465,7 +465,7 @@ class ReportDialog(ManagedWindow): # Save Frame self.doc_label = Gtk.Label(label="%s:" % _("Filename")) - self.doc_label.set_alignment(0.0, 0.5) + self.doc_label.set_halign(Gtk.Align.START) self.grid.attach(self.doc_label, 1, self.row, 1, 1) self.target_fileentry.set_hexpand(True) @@ -613,7 +613,7 @@ class ReportDialog(ManagedWindow): self.uistate, self.track) if has_label: widget_text = Gtk.Label('%s:' % option.get_label()) - widget_text.set_alignment(0.0, 0.0) + widget_text.set_halign(Gtk.Align.START) self.grid.attach(widget_text, 1, self.row, 1, 1) self.doc_widgets.append(widget_text) self.grid.attach(widget, 2, self.row, 2, 1) diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 832f03a21..721706faf 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -1229,7 +1229,7 @@ class ViewManager(CLIManager): label = Gtk.Label(label=_("Path:")) label.set_justify(Gtk.Justification.LEFT) label.set_size_request(90, -1) - label.set_alignment(0, .5) + label.set_halign(Gtk.Align.START) hbox.pack_start(label, False, True, 0) path_entry = Gtk.Entry() text = config.get('paths.quick-backup-directory') @@ -1249,7 +1249,7 @@ class ViewManager(CLIManager): label = Gtk.Label(label=_("File:")) label.set_justify(Gtk.Justification.LEFT) label.set_size_request(90, -1) - label.set_alignment(0, .5) + label.set_halign(Gtk.Align.START) hbox.pack_start(label, False, True, 0) struct_time = time.localtime() file_entry.set_text(config.get('paths.quick-backup-filename') % @@ -1281,7 +1281,7 @@ class ViewManager(CLIManager): label = Gtk.Label(label=_("Media:")) label.set_justify(Gtk.Justification.LEFT) label.set_size_request(90, -1) - label.set_alignment(0, .5) + label.set_halign(Gtk.Align.START) hbox.pack_start(label, False, True, 0) include = Gtk.RadioButton(None, "%s (%s %s)" % (_("Include"), mbytes, _("Megabyte|MB"))) diff --git a/gramps/gui/views/listview.py b/gramps/gui/views/listview.py index 6253b38e2..f5fc65359 100644 --- a/gramps/gui/views/listview.py +++ b/gramps/gui/views/listview.py @@ -1005,7 +1005,7 @@ class ListView(NavigationView): combobox = Gtk.ComboBoxText() label = Gtk.Label(label=_("Format:")) - label.set_alignment(1.0, 0.5) + label.set_halign(Gtk.Align.END) box = Gtk.Box() box.pack_start(label, True, True, padding=12) box.pack_start(combobox, False, False, 0) diff --git a/gramps/gui/widgets/fanchart.py b/gramps/gui/widgets/fanchart.py index 60c9a4d0c..edca4cdac 100644 --- a/gramps/gui/widgets/fanchart.py +++ b/gramps/gui/widgets/fanchart.py @@ -1715,7 +1715,7 @@ class FanChartGrampsGUI(object): sib_item.set_image(go_image) label.set_use_markup(True) label.show() - label.set_alignment(0,0) + label.set_halign(Gtk.Align.START) sib_item.add(label) linked_persons.append(sib_id) sib_item.connect("activate", self.on_childmenu_changed, sib_id) @@ -1752,7 +1752,7 @@ class FanChartGrampsGUI(object): child_item.set_image(go_image) label.set_use_markup(True) label.show() - label.set_alignment(0,0) + label.set_halign(Gtk.Align.START) child_item.add(label) linked_persons.append(child_handle) child_item.connect("activate", self.on_childmenu_changed, child_handle) @@ -1789,7 +1789,7 @@ class FanChartGrampsGUI(object): par_item.set_image(go_image) label.set_use_markup(True) label.show() - label.set_alignment(0,0) + label.set_halign(Gtk.Align.START) par_item.add(label) linked_persons.append(par_id) par_item.connect("activate", self.on_childmenu_changed, par_id) @@ -1832,7 +1832,7 @@ class FanChartGrampsGUI(object): per_item.set_image(go_image) label.set_use_markup(True) label.show() - label.set_alignment(0, 0) + label.set_halign(Gtk.Align.START) per_item.add(label) per_item.connect("activate", self.on_childmenu_changed, p_id) per_item.show() diff --git a/gramps/gui/widgets/grampletbar.py b/gramps/gui/widgets/grampletbar.py index baca56b8e..90610e2e5 100644 --- a/gramps/gui/widgets/grampletbar.py +++ b/gramps/gui/widgets/grampletbar.py @@ -341,7 +341,7 @@ class GrampletBar(Gtk.Notebook): tab_label.show() msg = _('Select the down arrow on the right corner for adding, removing or restoring gramplets.') content = Gtk.Label(label=msg) - content.set_alignment(0, 0) + content.set_halign(Gtk.Align.START) content.set_line_wrap(True) content.set_size_request(150, -1) content.show() diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py index eedd3b7e1..6fa669937 100644 --- a/gramps/gui/widgets/grampletpane.py +++ b/gramps/gui/widgets/grampletpane.py @@ -569,7 +569,7 @@ class GuiGramplet(object): topbox.pack_start(hbox, False, False, 0) for item in self.pui.option_order: label = Gtk.Label(label=item + ":") - label.set_alignment(1.0, 0.5) + label.set_halign(Gtk.Align.END) labels.pack_start(label, True, True, 0) options.pack_start(self.pui.option_dict[item][0], True, True, 0) # widget save_button = Gtk.Button.new_with_mnemonic(_('_Save')) diff --git a/gramps/gui/widgets/labels.py b/gramps/gui/widgets/labels.py index 80553ffa6..76f9dc597 100644 --- a/gramps/gui/widgets/labels.py +++ b/gramps/gui/widgets/labels.py @@ -126,7 +126,7 @@ class LinkLabel(Gtk.EventBox): self.label = Gtk.Label(label=text) self.label.set_use_markup(True) - self.label.set_alignment(0, 0.5) + self.label.set_halign(Gtk.Align.START) hbox = Gtk.Box() hbox.pack_start(self.label, False, False, 0) @@ -205,7 +205,7 @@ class BasicLabel(Gtk.Label): def __init__(self, text, ellipsize=Pango.EllipsizeMode.NONE): GObject.GObject.__init__(self, label=text) - self.set_alignment(0, 0.5) + self.set_halign(Gtk.Align.START) self.set_ellipsize(ellipsize) self.show() @@ -218,7 +218,7 @@ class GenderLabel(Gtk.Label): def __init__(self, text): GObject.GObject.__init__(self, label=text) - self.set_alignment(0, 0.5) + self.set_halign(Gtk.Align.START) if win(): pangoFont = Pango.FontDescription('Arial') self.override_font(pangoFont) @@ -231,9 +231,9 @@ class GenderLabel(Gtk.Label): #------------------------------------------------------------------------- class MarkupLabel(Gtk.Label): - def __init__(self, text, x_align=0, y_align=0.5): + def __init__(self, text, halign=Gtk.Align.START): GObject.GObject.__init__(self, label=text) - self.set_alignment(x_align, y_align) + self.set_halign(halign) self.set_use_markup(True) self.show_all() @@ -244,10 +244,10 @@ class MarkupLabel(Gtk.Label): #------------------------------------------------------------------------- class DualMarkupLabel(Gtk.Box): - def __init__(self, text, alt, x_align=0, y_align=0.5): + def __init__(self, text, alt, halign=Gtk.Align.START): Gtk.Box.__init__(self) label = Gtk.Label(label=text) - label.set_alignment(x_align, y_align) + label.set_halign(halign) label.set_use_markup(True) self.pack_start(label, False, False, 0) diff --git a/gramps/gui/widgets/monitoredwidgets.py b/gramps/gui/widgets/monitoredwidgets.py index 95a811d4a..47d5f4514 100644 --- a/gramps/gui/widgets/monitoredwidgets.py +++ b/gramps/gui/widgets/monitoredwidgets.py @@ -833,7 +833,7 @@ class MonitoredTagList(object): self.all_tags.append((tag.get_handle(), tag.get_name())) self.label = label - self.label.set_alignment(0, 0.5) + self.label.set_halign(Gtk.Align.START) self.label.set_ellipsize(Pango.EllipsizeMode.END) image = Gtk.Image() image.set_from_icon_name('gramps-tag', Gtk.IconSize.MENU) diff --git a/gramps/gui/widgets/statusbar.py b/gramps/gui/widgets/statusbar.py index d5df55e6d..770acab69 100644 --- a/gramps/gui/widgets/statusbar.py +++ b/gramps/gui/widgets/statusbar.py @@ -64,7 +64,7 @@ class Statusbar(Gtk.Box): self.__status.show() self.__filter = Gtk.Label() - self.__filter.set_alignment(1.0, 0.5) + self.__filter.set_halign(Gtk.Align.END) self.__filter.show() self.pack_start(self.__warnbtn, False, True, 4) diff --git a/gramps/plugins/gramplet/eval.py b/gramps/plugins/gramplet/eval.py index dc3e7fab9..b9864be23 100644 --- a/gramps/plugins/gramplet/eval.py +++ b/gramps/plugins/gramplet/eval.py @@ -90,9 +90,8 @@ class PythonEvaluation(Gramplet): """ Add a text view to the interface. """ - label = Gtk.Label(name) + label = Gtk.Label(halign=Gtk.Align.START) label.set_markup('%s' % name) - label.set_alignment(0, 0.5) self.top.pack_start(label, False, False, 6) swin = Gtk.ScrolledWindow() swin.set_shadow_type(Gtk.ShadowType.IN) diff --git a/gramps/plugins/gramplet/leak.py b/gramps/plugins/gramplet/leak.py index 37079b953..81308fd7a 100644 --- a/gramps/plugins/gramplet/leak.py +++ b/gramps/plugins/gramplet/leak.py @@ -77,8 +77,7 @@ class Leak(Gramplet): self.top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.top.set_border_width(6) - self.label = Gtk.Label() - self.label.set_alignment(0, 0.5) + self.label = Gtk.Label(halign=Gtk.Align.START) self.top.pack_start(self.label, False, False, 6) self.scroll = Gtk.ScrolledWindow() diff --git a/gramps/plugins/gramplet/persondetails.py b/gramps/plugins/gramplet/persondetails.py index 68a64dc5d..47e2d42ba 100644 --- a/gramps/plugins/gramplet/persondetails.py +++ b/gramps/plugins/gramplet/persondetails.py @@ -48,8 +48,7 @@ class PersonDetails(Gramplet): vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.photo = Photo(self.uistate.screen_height() < 1000) self.photo.show() - self.name = Gtk.Label() - self.name.set_alignment(0, 0) + self.name = Gtk.Label(halign=Gtk.Align.START) self.name.override_font(Pango.FontDescription('sans bold 12')) vbox.pack_start(self.name, fill=True, expand=False, padding=7) self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL) @@ -64,11 +63,10 @@ class PersonDetails(Gramplet): """ Add a row to the table. """ - label = Gtk.Label(label=title + ':') - label.set_alignment(1, 0) + label = Gtk.Label(label=title + ':', halign=Gtk.Align.END, + valign=Gtk.Align.START) label.show() - value = Gtk.Label(label=value) - value.set_alignment(0, 0) + value = Gtk.Label(label=value, halign=Gtk.Align.START) value.show() self.grid.add(label) self.grid.attach_next_to(value, label, Gtk.PositionType.RIGHT, 1, 1) diff --git a/gramps/plugins/gramplet/placedetails.py b/gramps/plugins/gramplet/placedetails.py index bc9d1a42f..f79bf4581 100644 --- a/gramps/plugins/gramplet/placedetails.py +++ b/gramps/plugins/gramplet/placedetails.py @@ -43,8 +43,7 @@ class PlaceDetails(Gramplet): self.top = Gtk.Box() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.photo = Photo(self.uistate.screen_height() < 1000) - self.title = Gtk.Label() - self.title.set_alignment(0, 0) + self.title = Gtk.Label(halign=Gtk.Align.START) self.title.override_font(Pango.FontDescription('sans bold 12')) vbox.pack_start(self.title, False, True, 7) self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL) @@ -59,11 +58,10 @@ class PlaceDetails(Gramplet): """ Add a row to the table. """ - label = Gtk.Label(label=title + ':') - label.set_alignment(1, 0) + label = Gtk.Label(label=title + ':', halign=Gtk.Align.END, + valign=Gtk.Align.START) label.show() - value = Gtk.Label(label=value) - value.set_alignment(0, 0) + value = Gtk.Label(label=value, halign=Gtk.Align.START) value.show() self.grid.add(label) self.grid.attach_next_to(value, label, Gtk.PositionType.RIGHT, 1, 1) diff --git a/gramps/plugins/gramplet/repositorydetails.py b/gramps/plugins/gramplet/repositorydetails.py index 99c843007..906ba060a 100644 --- a/gramps/plugins/gramplet/repositorydetails.py +++ b/gramps/plugins/gramplet/repositorydetails.py @@ -39,8 +39,7 @@ class RepositoryDetails(Gramplet): """ self.top = Gtk.Box() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) - self.name = Gtk.Label() - self.name.set_alignment(0, 0) + self.name = Gtk.Label(halign=Gtk.Align.START) self.name.override_font(Pango.FontDescription('sans bold 12')) vbox.pack_start(self.name, fill=True, expand=False, padding=7) self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL) @@ -54,11 +53,10 @@ class RepositoryDetails(Gramplet): """ Add a row to the table. """ - label = Gtk.Label(label=title + ':') - label.set_alignment(1, 0) + label = Gtk.Label(label=title + ':', halign=Gtk.Align.END, + valign=Gtk.Align.START) label.show() - value = Gtk.Label(label=value) - value.set_alignment(0, 0) + value = Gtk.Label(label=value, halign=Gtk.Align.START) value.show() self.grid.add(label) self.grid.attach_next_to(value, label, Gtk.PositionType.RIGHT, 1, 1) diff --git a/gramps/plugins/gramplet/soundgen.py b/gramps/plugins/gramplet/soundgen.py index 2bbdfb5ff..14f2e1277 100644 --- a/gramps/plugins/gramplet/soundgen.py +++ b/gramps/plugins/gramplet/soundgen.py @@ -62,16 +62,13 @@ class SoundGen(Gramplet): grid.set_border_width(6) grid.set_row_spacing(6) grid.set_column_spacing(20) - label1 = Gtk.Label(_("Name:")) - label1.set_alignment(0, 0.5) + label1 = Gtk.Label(label=_("Name:"), halign=Gtk.Align.START) grid.attach(label1, 0, 0, 1, 1) - label2 = Gtk.Label(_("SoundEx code:")) - label2.set_alignment(0, 0.5) + label2 = Gtk.Label(label=_("SoundEx code:"), halign=Gtk.Align.START) grid.attach(label2, 0, 1, 1, 1) self.autocomp = Gtk.ComboBox.new_with_entry() grid.attach(self.autocomp, 1, 0, 1, 1) - self.value = Gtk.Label() - self.value.set_alignment(0, 0.5) + self.value = Gtk.Label(halign=Gtk.Align.START) grid.attach(self.value, 1, 1, 1, 1) self.name = self.autocomp.get_child() diff --git a/gramps/plugins/gramplet/todogramplet.py b/gramps/plugins/gramplet/todogramplet.py index 61fe9a4e1..f9cc5ca6b 100644 --- a/gramps/plugins/gramplet/todogramplet.py +++ b/gramps/plugins/gramplet/todogramplet.py @@ -64,8 +64,7 @@ class ToDoGramplet(Gramplet): self.page = Gtk.Label() hbox.pack_end(self.page, False, False, 10) - self.title = Gtk.Label() - self.title.set_alignment(0, 0) + self.title = Gtk.Label(halign=Gtk.Align.START) self.title.set_line_wrap(True) scrolledwindow = Gtk.ScrolledWindow() diff --git a/gramps/plugins/sidebar/categorysidebar.py b/gramps/plugins/sidebar/categorysidebar.py index 51a104d24..9841103c7 100644 --- a/gramps/plugins/sidebar/categorysidebar.py +++ b/gramps/plugins/sidebar/categorysidebar.py @@ -163,7 +163,6 @@ class CategorySidebar(BaseSidebar): # create the button button = Gtk.ToggleButton() button.set_relief(Gtk.ReliefStyle.NONE) - button.set_alignment(0, 0.5) self.buttons.append(button) # add the tooltip diff --git a/gramps/plugins/sidebar/dropdownsidebar.py b/gramps/plugins/sidebar/dropdownsidebar.py index b68015201..fa0fb17a7 100644 --- a/gramps/plugins/sidebar/dropdownsidebar.py +++ b/gramps/plugins/sidebar/dropdownsidebar.py @@ -146,14 +146,12 @@ class DropdownSidebar(BaseSidebar): # create the button button = Gtk.ToggleButton() button.set_relief(Gtk.ReliefStyle.NONE) - button.set_alignment(0, 0.5) self.buttons.append(button) # create the drop-down button to display views if len(self.views[cat_num]) > 1: dropdown = Gtk.Button() dropdown.set_relief(Gtk.ReliefStyle.NONE) - dropdown.set_alignment(0.5, 0.5) arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.DOWN, shadow_type=Gtk.ShadowType.NONE) dropdown.add(arrow) diff --git a/gramps/plugins/sidebar/expandersidebar.py b/gramps/plugins/sidebar/expandersidebar.py index d0273920d..effc8b07c 100644 --- a/gramps/plugins/sidebar/expandersidebar.py +++ b/gramps/plugins/sidebar/expandersidebar.py @@ -172,7 +172,6 @@ class ExpanderSidebar(BaseSidebar): # create the button button = Gtk.ToggleButton() button.set_relief(Gtk.ReliefStyle.NONE) - button.set_alignment(0, 0.5) self.buttons.append(button) self.lookup[(cat_num, view_num)] = len(self.buttons) - 1 diff --git a/gramps/plugins/tool/mediamanager.py b/gramps/plugins/tool/mediamanager.py index 23158fb5b..be2aa0a6e 100644 --- a/gramps/plugins/tool/mediamanager.py +++ b/gramps/plugins/tool/mediamanager.py @@ -318,9 +318,9 @@ class ConfirmationPage(Gtk.Box): self.set_border_width(12) self.confirm = Gtk.Label() + self.confirm.set_halign(Gtk.Align.START) self.confirm.set_line_wrap(True) self.confirm.set_use_markup(True) - self.confirm.set_alignment(0, 0.5) self.pack_start(self.confirm, False, True, 0) scrolled_window = Gtk.ScrolledWindow() @@ -494,8 +494,8 @@ class PathChange(BatchOp): grid.attach(self.from_entry, 1, 0, 1, 1) from_label = Gtk.Label(label=_('_Replace:')) + from_label.set_halign(Gtk.Align.START) from_label.set_use_underline(True) - from_label.set_alignment(0, 0.5) from_label.set_mnemonic_widget(self.from_entry) grid.attach(from_label, 0, 0, 1, 1) @@ -504,8 +504,8 @@ class PathChange(BatchOp): grid.attach(self.to_entry, 1, 1, 1, 1) to_label = Gtk.Label(label=_('_With:')) + to_label.set_halign(Gtk.Align.START) to_label.set_use_underline(True) - to_label.set_alignment(0, 0.5) to_label.set_mnemonic_widget(self.to_entry) grid.attach(to_label, 0, 1, 1, 1) diff --git a/gramps/plugins/tool/testcasegenerator.py b/gramps/plugins/tool/testcasegenerator.py index 1140c6a22..da401a300 100644 --- a/gramps/plugins/tool/testcasegenerator.py +++ b/gramps/plugins/tool/testcasegenerator.py @@ -233,7 +233,7 @@ class TestcaseGenerator(tool.BatchTool): self.label = Gtk.Label(label=_("Number of people to generate\n" "(Number is approximate because families " "are generated)")) - self.label.set_alignment(0.0, 0.5) + self.label.set_halign(Gtk.Align.START) self.top.vbox.pack_start(self.label,0,0,5) self.entry_count = Gtk.Entry() diff --git a/gramps/plugins/view/pedigreeview.py b/gramps/plugins/view/pedigreeview.py index 95c96c4d4..59965f561 100644 --- a/gramps/plugins/view/pedigreeview.py +++ b/gramps/plugins/view/pedigreeview.py @@ -1063,7 +1063,7 @@ class PedigreeView(NavigationView): label.set_justify(Gtk.Justification.LEFT) label.set_use_markup(True) label.set_line_wrap(True) - label.set_alignment(0.1, 0.5) + label.set_halign(Gtk.Align.START) if self.tree_style in [0, 2]: x_pos = (1 + _width) * (level + 1) + 1 y_pos = _delta // 2 + offset * _delta -1 + _height // 2 @@ -1447,7 +1447,7 @@ class PedigreeView(NavigationView): label = Gtk.Label(label=cname) label.set_use_markup(True) label.show() - label.set_alignment(0, 0) + label.set_halign(Gtk.Align.START) menuitem = Gtk.ImageMenuItem() go_image = Gtk.Image.new_from_icon_name('go-jump', Gtk.IconSize.MENU) @@ -1724,7 +1724,7 @@ class PedigreeView(NavigationView): sib_item.set_image(go_image) label.set_use_markup(True) label.show() - label.set_alignment(0, 0) + label.set_halign(Gtk.Align.START) sib_item.add(label) linked_persons.append(sib_id) sib_item.connect("activate", self.cb_childmenu_changed, sib_id) @@ -1763,7 +1763,7 @@ class PedigreeView(NavigationView): child_item.set_image(go_image) label.set_use_markup(True) label.show() - label.set_alignment(0, 0) + label.set_halign(Gtk.Align.START) child_item.add(label) linked_persons.append(child_handle) child_item.connect("activate", self.cb_childmenu_changed, @@ -1803,7 +1803,7 @@ class PedigreeView(NavigationView): par_item.set_image(go_image) label.set_use_markup(True) label.show() - label.set_alignment(0, 0) + label.set_halign(Gtk.Align.START) par_item.add(label) linked_persons.append(par_id) par_item.connect("activate", self.cb_childmenu_changed, par_id) @@ -1849,7 +1849,7 @@ class PedigreeView(NavigationView): per_item.set_image(go_image) label.set_use_markup(True) label.show() - label.set_alignment(0, 0) + label.set_halign(Gtk.Align.START) per_item.add(label) per_item.connect("activate", self.cb_childmenu_changed, p_id) per_item.show() diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index fcfb25bbd..5ffd301e4 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -560,7 +560,7 @@ class RelationshipView(NavigationView): fmt = '%s' text = fmt % escape(name) label = widgets.DualMarkupLabel(text, _GenderCode[person.gender], - x_align=1) + halign=Gtk.Align.END) if self._config.get('preferences.releditbtn'): button = widgets.IconButton(self.edit_button_press, person.handle) @@ -742,7 +742,7 @@ class RelationshipView(NavigationView): """ msg = '%s' % escape(title) hbox = Gtk.Box() - label = widgets.MarkupLabel(msg, x_align=1) + label = widgets.MarkupLabel(msg, halign=Gtk.Align.END) # Draw the collapse/expand button: if family is not None: if self.check_collapsed(person.handle, family.handle): @@ -1013,7 +1013,7 @@ class RelationshipView(NavigationView): format = "%s" label = widgets.MarkupLabel(format % escape(title), - x_align=1, y_align=0) + halign=Gtk.Align.END) if self._config.get('preferences.releditbtn'): label.set_padding(0, 5) @@ -1050,7 +1050,7 @@ class RelationshipView(NavigationView): self._set_draggable_person(eventbox, handle) else: link_label = Gtk.Label(label=_('Unknown')) - link_label.set_alignment(0, 1) + link_label.set_halign(Gtk.Align.START) link_label.show() vbox.pack_start(link_label, True, True, 0) @@ -1112,7 +1112,7 @@ class RelationshipView(NavigationView): format = "%s" lbl = widgets.MarkupLabel(format % escape(title), - x_align=1, y_align=.5) + halign=Gtk.Align.END) if self._config.get('preferences.releditbtn'): lbl.set_padding(0, 5) return lbl @@ -1174,7 +1174,7 @@ class RelationshipView(NavigationView): hbox = Gtk.Box() l = widgets.BasicLabel("%d." % index) l.set_width_chars(3) - l.set_alignment(1.0, 0.5) + l.set_halign(Gtk.Align.END) hbox.pack_start(l, False, False, 0) hbox.pack_start(widgets.LinkBox(link_label, button), False, False, 4) @@ -1275,7 +1275,7 @@ class RelationshipView(NavigationView): image.show() label = Gtk.Label(label=_("Edit %s") % name) label.show() - label.set_alignment(0, 0) + label.set_halign(Gtk.Align.START) item.set_image(image) item.add(label)