From 068274feed324433a12313a97c4eeff52a3de572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 27 Dec 2019 23:11:19 +0100 Subject: [PATCH] MessageInput: Set min height for vertical scrollbar Fixes #9574, #8980 --- gajim/chat_control_base.py | 20 ++------------------ gajim/data/style/gajim.css | 1 + 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/gajim/chat_control_base.py b/gajim/chat_control_base.py index 486fa3c24..8f708a876 100644 --- a/gajim/chat_control_base.py +++ b/gajim/chat_control_base.py @@ -1567,22 +1567,6 @@ class ScrolledWindow(Gtk.ScrolledWindow): self.get_style_context().add_class('scrolled-no-border') self.get_style_context().add_class('no-scroll-indicator') self.get_style_context().add_class('scrollbar-style') + self.get_style_context().add_class('one-line-scrollbar') self.set_shadow_type(Gtk.ShadowType.IN) - - def do_get_preferred_height(self): - min_height, natural_height = Gtk.ScrolledWindow.do_get_preferred_height(self) - # Gtk Bug: If policy is set to Automatic, the ScrolledWindow - # 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 height). - # 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) - else: - GLib.idle_add(self.set_policy, - Gtk.PolicyType.AUTOMATIC, - Gtk.PolicyType.AUTOMATIC) - - return min_height, natural_height + self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) diff --git a/gajim/data/style/gajim.css b/gajim/data/style/gajim.css index 8d7b2864e..359bdbdab 100644 --- a/gajim/data/style/gajim.css +++ b/gajim/data/style/gajim.css @@ -21,6 +21,7 @@ .scrollbar-style scrollbar trough {background-color:@theme_base_color; } .scrollbar-style scrollbar {border:none; } .scrollbar-style slider {min-width: 3px; background-color: #a0a3a4} +.one-line-scrollbar scrollbar.vertical slider { min-height: 20px; } .actionbar-no-border box {border: none} .actionbar-no-border button { -- GitLab