From 27ffae2af4df1dbb63ed5add8d60ab52d3053bb6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20H=C3=B6rist?= <philipp@hoerist.com>
Date: Tue, 20 Feb 2018 22:03:57 +0100
Subject: [PATCH] Fix MessagTextview height

On some Desktops eg. Mate, the MessageTextview was to big, because
the default height seems to be 82.

What influences the default height (compare Windows where it is 46),
is unclear.
---
 gajim/chat_control_base.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gajim/chat_control_base.py b/gajim/chat_control_base.py
index e557c59fdf..9fd609bb1d 100644
--- a/gajim/chat_control_base.py
+++ b/gajim/chat_control_base.py
@@ -1380,13 +1380,12 @@ class ScrolledWindow(Gtk.ScrolledWindow):
 
     def do_get_preferred_height(self):
         min_height, natural_height = Gtk.ScrolledWindow.do_get_preferred_height(self)
-        child = self.get_child()
         # Gtk Bug: If policy is set to Automatic, the ScrolledWindow
-        # has a min size of around 46 depending on the System. Because
-        # we want it smaller, we set policy NEVER if the height is < 50
+        # has a min size of around 46-82 depending on the System. Because
+        # we want it smaller, we set policy NEVER if the height is < 90
         # so the ScrolledWindow will shrink to around 26 (1 line heigh).
-        # Once it gets over 50 its no problem to restore the policy.
-        if natural_height < 50:
+        # Once it gets over 90 its no problem to restore the policy.
+        if natural_height < 90:
             GLib.idle_add(self.set_policy,
                           Gtk.PolicyType.AUTOMATIC,
                           Gtk.PolicyType.NEVER)
-- 
GitLab