scrolledwindow: Kinetic scrolling support

Kinetic scrolling is only done on touch devices, since it is
sort of meaningless on pointer devices, besides it implies
a different input event handling on child widgets that is
unnecessary there.

If the scrolling doesn't start after a long press, the scrolling is
cancelled and events are handled by child widgets normally.

When clicked again close to the previous button press location
(assuming it had ~0 movement), the scrolled window will allow
the child to handle the events immediately.

This is so the user doesn't have to wait to the press-and-hold
timeout in order to operate on the scrolledwindow child.

The innermost scrolled window always gets to capture the events, all
scrolled windows above it just let the event go through. Ideally
reaching a limit on the innermost scrolled window would propagate
the dragging up the hierarchy in order to keep following the touch
coords, although that'd involve rather evil hacks just to cater
for broken UIs.
This commit is contained in:
Carlos Garcia Campos 2011-02-11 13:43:56 +01:00 committed by Matthias Clasen
parent 8689921b90
commit f6393199be
4 changed files with 1084 additions and 12 deletions

View File

@ -2939,6 +2939,10 @@ gtk_scrolled_window_get_min_content_width
gtk_scrolled_window_set_min_content_width
gtk_scrolled_window_get_min_content_height
gtk_scrolled_window_set_min_content_height
gtk_scrolled_window_set_kinetic_scrolling
gtk_scrolled_window_get_kinetic_scrolling
gtk_scrolled_window_set_capture_button_press
gtk_scrolled_window_get_capture_button_press
<SUBSECTION Standard>
GTK_SCROLLED_WINDOW

View File

@ -2367,6 +2367,8 @@ gtk_scrollbar_new
gtk_scrolled_window_add_with_viewport
gtk_scrolled_window_get_hadjustment
gtk_scrolled_window_get_hscrollbar
gtk_scrolled_window_get_kinetic_scrolling
gtk_scrolled_window_get_capture_button_press
gtk_scrolled_window_get_min_content_height
gtk_scrolled_window_get_min_content_width
gtk_scrolled_window_get_placement
@ -2377,6 +2379,8 @@ gtk_scrolled_window_get_vadjustment
gtk_scrolled_window_get_vscrollbar
gtk_scrolled_window_new
gtk_scrolled_window_set_hadjustment
gtk_scrolled_window_set_kinetic_scrolling
gtk_scrolled_window_set_capture_button_press
gtk_scrolled_window_set_min_content_height
gtk_scrolled_window_set_min_content_width
gtk_scrolled_window_set_placement

File diff suppressed because it is too large Load Diff

View File

@ -115,6 +115,17 @@ void gtk_scrolled_window_set_min_content_width (GtkScrolledWindow *sc
gint gtk_scrolled_window_get_min_content_height (GtkScrolledWindow *scrolled_window);
void gtk_scrolled_window_set_min_content_height (GtkScrolledWindow *scrolled_window,
gint height);
GDK_AVAILABLE_IN_3_4
void gtk_scrolled_window_set_kinetic_scrolling (GtkScrolledWindow *scrolled_window,
gboolean kinetic_scrolling);
GDK_AVAILABLE_IN_3_4
gboolean gtk_scrolled_window_get_kinetic_scrolling (GtkScrolledWindow *scrolled_window);
GDK_AVAILABLE_IN_3_4
void gtk_scrolled_window_set_capture_button_press (GtkScrolledWindow *scrolled_window,
gboolean capture_button_press);
GDK_AVAILABLE_IN_3_4
gboolean gtk_scrolled_window_get_capture_button_press (GtkScrolledWindow *scrolled_window);
gint _gtk_scrolled_window_get_scrollbar_spacing (GtkScrolledWindow *scrolled_window);