[meld] ui.statusbar: Ellipsize status bar button labels (#561)



commit 60da6b9f6f5bf228725117baa56cf5d72ced54cf
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Mar 6 07:26:05 2021 +1000

    ui.statusbar: Ellipsize status bar button labels (#561)
    
    While not generally an issue in two-pane mode, in three-pane comparisons
    we can get in to a situation where the status bar button widths severely
    restrict the minimum window width. This was technically a problem in
    3.20.x, but because there was one fewer button and we didn't provide a
    generous minimum allocation for the line/column display, it wasn't as
    big of a deal.

 meld/ui/statusbar.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/meld/ui/statusbar.py b/meld/ui/statusbar.py
index 0852b661..da275ae2 100644
--- a/meld/ui/statusbar.py
+++ b/meld/ui/statusbar.py
@@ -64,11 +64,13 @@ class MeldStatusMenuButton(Gtk.MenuButton):
 
         # Ideally this would be a template child, but there's still no
         # Python support for this.
-        label = Gtk.Label()
-        label.props.single_line_mode = True
-        label.props.halign = Gtk.Align.START
-        label.props.valign = Gtk.Align.BASELINE
-        label.props.xalign = 1.0
+        label = Gtk.Label(
+            single_line_mode=True,
+            halign=Gtk.Align.START,
+            valign=Gtk.Align.BASELINE,
+            xalign=1.0,
+            ellipsize=Pango.EllipsizeMode.END,
+        )
 
         arrow = Gtk.Image.new_from_icon_name(
             'pan-down-symbolic', Gtk.IconSize.SMALL_TOOLBAR)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]