GtkScrolledWindow: Add documentation

Document the new overlay scrolling APIs, and add some more
documentation for the other touch support: kinetic scrolling
and overshoot.
This commit is contained in:
Matthias Clasen 2014-10-20 22:13:51 -04:00
parent 5ec56d2e6e
commit 4ed98878c6
2 changed files with 51 additions and 3 deletions

View File

@ -3154,6 +3154,8 @@ 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
gtk_scrolled_window_set_overlay_scrolling
gtk_scrolled_window_get_overlay_scrolling
<SUBSECTION Standard>
GTK_SCROLLED_WINDOW

View File

@ -87,6 +87,23 @@
* If a GtkScrolledWindow doesnt behave quite as you would like, or
* doesnt have exactly the right layout, its very possible to set up
* your own scrolling with #GtkScrollbar and for example a #GtkGrid.
*
* # Touch support
*
* GtkScrolledWindow has built-in support for touch devices. When a
* touchscreen is used, swiping will move the scrolled window, and will
* expose 'kinetic' behavior. This can be turned off with the
* #GtkScrolledWindow:kinetic-scrolling property if it is undesired.
*
* GtkScrolledWindow also displays visual 'overshoot' indication when
* the content is pulled beyond the end, and this situation can be
* captured with the #GtkScrolledWindow::edge-overshot signal.
*
* If no mouse device is present, the scrollbars will overlayed as
* narrow, auto-hiding indicators over the content. If traditional
* scrollbars are desired although no mouse is present, this behaviour
* can be turned off with the #GtkScrolledWindow:overlay-scrolling
* property.
*/
@ -526,8 +543,8 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
/**
* GtkScrolledWindow:kinetic-scrolling:
*
* The kinetic scrolling behavior flags. Kinetic scrolling
* only applies to devices with source %GDK_SOURCE_TOUCHSCREEN
* Whether kinetic scrolling is enabled or not. Kinetic scrolling
* only applies to devices with source %GDK_SOURCE_TOUCHSCREEN.
*
* Since: 3.4
*/
@ -539,6 +556,16 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
TRUE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
/**
* GtkScrolledWindow:overlay-scrolling:
*
* Whether overlay scrolling is enabled or not. If it is, the
* scrollbars are only added as traditional widgets when a mouse
* is present. Otherwise, they are overlayed on top of the content,
* as narrow indicators.
*
* Since: 3.16
*/
g_object_class_install_property (gobject_class,
PROP_OVERLAY_SCROLLING,
g_param_spec_boolean ("overlay-scrolling",
@ -3703,7 +3730,7 @@ gtk_scrolled_window_device_removed (GdkDeviceManager *dm,
GdkDevice *device,
GtkScrolledWindow *scrolled_window)
{
/* We need to work around the fact that ::device-removed is emitted
/* Work around the fact that ::device-removed is emitted
* before the device is removed from the list.
*/
g_object_set_data (G_OBJECT (device), "removed", GINT_TO_POINTER (1));
@ -3875,6 +3902,15 @@ gtk_scrolled_window_set_min_content_height (GtkScrolledWindow *scrolled_window,
}
}
/**
* gtk_scrolled_window_set_overlay_scrolling:
* @scrolled_window: a #GtkScrolledWindow
* @overlay_scrolling: whether to enable overlay scrolling
*
* Enables or disables overlay scrolling for this scrolled window.
*
* Since: 3.16
*/
void
gtk_scrolled_window_set_overlay_scrolling (GtkScrolledWindow *scrolled_window,
gboolean overlay_scrolling)
@ -3896,6 +3932,16 @@ gtk_scrolled_window_set_overlay_scrolling (GtkScrolledWindow *scrolled_window,
}
}
/**
* gtk_scrolled_window_get_overlay_scrolling:
* @scrolled_window: a #GtkScrolledWindow
*
* Returns whether overlay scrolling is enabled for this scrolled window.
*
* Returns: %TRUE if overlay scrolling is enabled
*
* Since: 3.16
*/
gboolean
gtk_scrolled_window_get_overlay_scrolling (GtkScrolledWindow *scrolled_window)
{