sidebar: Fix oscillating scrollbar when hovered at the right place

This is a hack to fix this till the upstream bug is resolved.
See: https://gitlab.gnome.org/GNOME/gtk/-/issues/4938

Fixes: https://gitlab.gnome.org/GNOME/fractal/-/issues/925
This commit is contained in:
Julian Sparber 2022-09-14 12:11:40 +02:00
parent 7d0a61bbc1
commit 99911c3fcf
2 changed files with 10 additions and 1 deletions

View file

@ -148,7 +148,7 @@
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="vexpand">True</property>
<property name="hscrollbar-policy">never</property>
<property name="child">

View file

@ -60,6 +60,8 @@ mod imp {
#[template_child]
pub headerbar: TemplateChild<adw::HeaderBar>,
#[template_child]
pub scrolled_window: TemplateChild<gtk::ScrolledWindow>,
#[template_child]
pub listview: TemplateChild<gtk::ListView>,
#[template_child]
pub room_search_entry: TemplateChild<gtk::SearchEntry>,
@ -259,6 +261,13 @@ mod imp {
btn.set_popover(Some(account_switcher));
}
}));
// FIXME: Remove this hack once https://gitlab.gnome.org/GNOME/gtk/-/issues/4938 is resolved
self.scrolled_window
.vscrollbar()
.first_child()
.unwrap()
.set_overflow(gtk::Overflow::Hidden);
}
}