GNOME Bugzilla – Bug 730730
scrolling is broken when sharing adjustments
Last modified: 2014-10-10 00:19:15 UTC
Created attachment 277158 [details] [review] fix scrolling with shared adjustment Look at the standalone test app at: https://github.com/Buzztrax/buzztrax/blob/master/design/gui/syncviews.c
To test the patch: wget https://raw.githubusercontent.com/Buzztrax/buzztrax/master/design/gui/syncviews.c gcc -Wall -g syncviews.c -o syncviews `pkg-config gtk+-3.0 --cflags --libs` -lm POLICY_ALWAYS=1 ./syncviews and scroll with the mouse-wheel on the left-side column of the list. It won't scroll, but the right one does. With the patch applied, both sides work.
Created attachment 287746 [details] [review] GtkScrolledWindow: Allow scrolling without bars Add a new policy, GTK_POLICY_EXTERNAL, which hides the scrollbar, but does not force the scrolled windows size to be determined by its child. This can be used to keep two scrolled windows in sync, while sharing a single scrollbar.
Created attachment 287747 [details] [review] Add an example for synchronized scrolling This example uses GTK_POLICY_EXTERNAL to share a scrollbar among multiple scrolled windows.
Created attachment 287748 [details] [review] Add an experiment for overlay scrollbars This is just meant as a prototype for how we can show a scroll position indicator for touch. This uses GTK_POLICY_EXTERNAL to hide the scrolled windows scrollbar while still allowing scrolling.
How the overlay looks: https://mclasen.fedorapeople.org/overlay-scroll.webm
*** Bug 726795 has been marked as a duplicate of this bug. ***
Review of attachment 287746 [details] [review]: Looks good, thanks. ::: gtk/gtkscrolledwindow.c @@ +2167,3 @@ else /* priv->hscrollbar_policy != GTK_POLICY_AUTOMATIC */ { + priv->hscrollbar_visible = priv->hscrollbar_policy < GTK_POLICY_NEVER; nit: turn into a function and/or add a comment to GtkPolicyType that the enum values must not be reordered?
Attachment 287746 [details] pushed as 94b680c - GtkScrolledWindow: Allow scrolling without bars