Commit 068274fe authored by Philipp Hörist's avatar Philipp Hörist

MessageInput: Set min height for vertical scrollbar

Fixes #9574, #8980
parent 162ca259
Pipeline #4798 passed with stages
in 3 minutes and 22 seconds
......@@ -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)
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment