[meld] ui.vcdialogs: Fix incorrect height-request override (#351)



commit d6313d491f8aaf68447ec90f5b1d7e3ce9883b1e
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Aug 31 11:37:37 2019 +1000

    ui.vcdialogs: Fix incorrect height-request override (#351)
    
    We set a height request for the scrolledwindow here to get a sensible
    height allocation for the commit message field, but then override it
    when setting the font-dependent width allocation.

 meld/ui/vcdialogs.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/meld/ui/vcdialogs.py b/meld/ui/vcdialogs.py
index 0111e6c4..bd1a8194 100644
--- a/meld/ui/vcdialogs.py
+++ b/meld/ui/vcdialogs.py
@@ -70,9 +70,10 @@ class CommitDialog(Gtk.Dialog):
         # Try and make the textview wide enough for a standard 80-character
         # commit message.
         context = self.textview.get_pango_context()
-        metrics = context.get_metrics(font, context.get_language())
+        metrics = context.get_metrics(None, None)
         char_width = metrics.get_approximate_char_width() / Pango.SCALE
-        self.scrolledwindow1.set_size_request(80 * char_width, -1)
+        width_request, height_request = self.scrolledwindow1.get_size_request()
+        self.scrolledwindow1.set_size_request(80 * char_width, height_request)
 
         settings.bind('vc-show-commit-margin', self.textview,
                       'show-right-margin', Gio.SettingsBindFlags.DEFAULT)


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