[fractal] sidebar: Fix oscillating scrollbar when hovered at the right place
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] sidebar: Fix oscillating scrollbar when hovered at the right place
- Date: Thu, 15 Sep 2022 07:48:55 +0000 (UTC)
commit 99911c3fcfe820a92ff77a15e1be61bc35e71eaa
Author: Julian Sparber <julian sparber net>
Date: Wed Sep 14 12:11:40 2022 +0200
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
data/resources/ui/sidebar.ui | 2 +-
src/session/sidebar/mod.rs | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/data/resources/ui/sidebar.ui b/data/resources/ui/sidebar.ui
index 2f3eb9b8f..69b31d73a 100644
--- a/data/resources/ui/sidebar.ui
+++ b/data/resources/ui/sidebar.ui
@@ -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">
diff --git a/src/session/sidebar/mod.rs b/src/session/sidebar/mod.rs
index 843951fc6..a32f4cacb 100644
--- a/src/session/sidebar/mod.rs
+++ b/src/session/sidebar/mod.rs
@@ -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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]