Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gajim/chat_control_base.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/gajim/chat_control_base.py b/gajim/chat_control_base.py
index 09797222e..b37ef220b 100644
--- a/gajim/chat_control_base.py
+++ b/gajim/chat_control_base.py
@@ -1343,15 +1343,23 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
class ScrolledWindow(Gtk.ScrolledWindow):
def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
+ Gtk.ScrolledWindow.__init__(self, *args, **kwargs)
def do_get_preferred_height(self):
min_height, natural_height = Gtk.ScrolledWindow.do_get_preferred_height(self)
child = self.get_child()
- if natural_height and self.get_max_content_height() > -1 and child:
- _, child_nat_height = child.get_preferred_height()
- if natural_height > child_nat_height:
- if child_nat_height < 26:
- return 26, 26
+ # 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
+ # 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:
+ GLib.idle_add(self.set_policy,
+ Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.NEVER)
+ else:
+ GLib.idle_add(self.set_policy,
+ Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC)
return min_height, natural_height