Commit Graph

251 Commits

Author SHA1 Message Date
Benjamin Otte
c4c383fa39 scrolledwindow: Remove unused variable 2014-07-22 15:06:26 +02:00
Carlos Garnacho
7bdc219464 scrolledwindow: Remove overshoot window and displacement animation
The displacement animation has been replaced by edge gradients, that
have a stronger color the harder overshooting is hit. This makes it
possible to remove the internal overshoot window, which was merely
used to have contents displaced when overshooting to top/left.

Overshooting to bottom/right used to cause queue_resize() to be
called on the scrolled window, this isn't necessary anymore either.

https://bugzilla.gnome.org/show_bug.cgi?id=731297
2014-07-09 23:13:48 -04:00
Matthias Clasen
939fbc43e1 GtkScrolledWindow: Animate the scroll-child keybinding 2014-07-02 20:58:16 -04:00
Matthias Clasen
3dcd0a24b1 GtkScrolledWindow: Enable animated scrolling
We use gtk_adjustment_enable_animation to enable animated
updates of the adjustments. Currently, this is enabled
unconditionally, and with a duration that is hardcoded.

https://bugzilla.gnome.org/show_bug.cgi?id=732376
2014-06-30 18:41:20 -04:00
Matthias Clasen
4067d0623f Revert "scrolledwindow: fix scrolling with shared adjustment"
This reverts commit f0478c3dfd.
Didn't mean to push this.
2014-06-28 22:29:57 -04:00
Stefan Sauer
f0478c3dfd scrolledwindow: fix scrolling with shared adjustment
The GtkPolicyType set on the scrollbar is just about the presentation. What
matters for scrolling is the adjustment.

https://bugzilla.gnome.org/show_bug.cgi?id=730730
2014-06-28 11:49:54 -04:00
Matthias Clasen
3bd2705b7a GtkScrolledWindow: Use style classes for shadow
Translate shadow != None into the FRAME style class.
This doesn't change the style classes used for drawing,
it only sets the style class permanently instead of
saving and restoring in draw().
https://bugzilla.gnome.org/show_bug.cgi?id=732256
2014-06-26 21:56:21 -04:00
Matthias Clasen
f0f9c2aa37 Revert "gtkbin: replace internal api"
This reverts commit 0f4751c08e.

This causes warnings from the notebook and combobox code.
2014-06-16 17:31:56 -04:00
Stefan Sauer
0f4751c08e gtkbin: replace internal api 2014-06-14 08:10:46 +02:00
Carlos Garnacho
3b636cbeb9 scrolledwindow: Deny scrolling sequences if pressed on the scrollbars
Scrollbars might be a bit too narrow for touch (and generally less useful
besides kinetic scrolling), but those should be functional nevertheless.
2014-06-12 15:17:47 +02:00
Matthias Clasen
ed6f9c1ee9 GtkScrolledWindow: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:08 -04:00
Lieven van der Heide
828594d5bd scrolledwindow: Replace kinetic scrolling with GtkKineticScrolling
Two GtkKineticScrolling helpers are used, one per axis direction.

https://bugzilla.gnome.org/show_bug.cgi?id=729608
2014-06-05 16:49:23 +02:00
Matthias Clasen
8817fa9e3d GtkScrolledWindow: Add some NULL checks back
Turns out these were not quite redundant, gtk_container_forall
may be called very early during construction.

https://bugzilla.gnome.org/show_bug.cgi?id=730924
2014-05-29 21:52:40 -04:00
Carlos Garnacho
d05a9f9a7b gesture: Replace gtk_gesture_attach/detach with event controller API
Event controllers now auto-attach, and the GtkCapturePhase only determines
when are events dispatched, but all controllers are managed by the widget wrt
grabs.

All callers have been updated.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
ad6606e8af gtk: Update callers of GtkGesturePan orientation 2014-05-27 17:47:12 +02:00
Carlos Garnacho
ef61c9c58b gtk: Replace GtkPanOrientation with GtkOrientation
And document GtkOrientation to be more generic. There's little added
value in a separate enum for this.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
d351c52114 scrolledwindow: Handle directional cancellation if there is a single scroll direction
A pan gesture is optionally attached if there is only one scrolling direction, the pan
gesture orientation is changed so movements tangential to the scroll direction get
scrolling cancelled (The pan gesture is automatically denied when that happens, and
that state change spreads to the others gestures in the group). If the pan direction
happens in the expected directions, no cancellation happens, and scrolling eventually
takes place.
2014-05-23 19:54:32 +02:00
Carlos Garnacho
5369c77029 gesture: Simplify gesture/widget interaction public API
The propagation phase property/methods in GtkEventController are gone,
This is now set directly on the GtkWidget add/remove controller API,
which has been made private.

The only public bit now are the new functions gtk_gesture_attach() and
gtk_gesture_detach() that will use the private API underneath.

All callers have been updated.
2014-05-23 19:54:29 +02:00
Carlos Garnacho
5c9f4bd078 gesture: Cancel sequences that make a gesture exceed the number of touches as they happen
This makes it possible to track those through gtk_gesture_handles_sequence(),
without guessing from last event type or sequence state.
2014-05-23 19:54:29 +02:00
Carlos Garnacho
490c356954 scrolledwindow: update to gesture widget-level API changes 2014-05-23 19:54:26 +02:00
Carlos Garnacho
6c78716531 scrolledwindow: Ensure the dragging sequence gets denied if more touches come in
This allows children to receive an emulated press, and handle it together with
the new touch that made the scrolledwindow sequence denied.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
564789777a scrolledwindow: Fix overshoot coordinates
With gtk_gesture_get_point() returning events in
gtk_event_controller_get_widget() coordinates, we no longer need
to compensate for the overshoot here.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
6cd0e733f5 scrolledwindow: Use GtkGestureSingle API 2014-05-23 19:54:24 +02:00
Carlos Garnacho
cece9cac07 scrolledwindow: Update gesture API change. 2014-05-23 19:54:23 +02:00
Carlos Garnacho
8d2f81cca4 scrolledwindow: Use gesture button/touch press synthesization
This makes scrolled window fully compatible again wrt the
GtkScrolledWindow::capture-button-press property.
2014-05-23 19:54:22 +02:00
Carlos Garnacho
83ef067ae1 scrolledwindow: port to GtkGesture
The kinetic scrolling feature is now implemented using a
GtkGestureDrag and a GtkGestureSwipe, plus a GtkGestureLongPress
in order to denying the sequence, so it is possibly handled
underneath.
2014-05-23 19:54:22 +02:00
Matthias Clasen
d01a291dbc GtkScrolledWindow: Avoid a test failure
The change to take out unneeded NULL checks requires some care
at startup: we check both adjustments when any of them changes;
we need to do those checks in the same order in which we create
the scrollbars, otherwise we'll try to get the adjustment of
the vscrollbar when we just set the up the hscrollbars' adjustment.
2014-05-22 06:00:09 -04:00
Björn Lindqvist
a61a11a4ea Remove redundant not-NULL checks from GtkScrolledWindow
The scrollbars are created at construction time and there is no
way to set them to NULL so remove the unnecessary NULL checks.

https://bugzilla.gnome.org/show_bug.cgi?id=525206
2014-05-21 23:04:42 -04:00
Benjamin Otte
9ee00c3522 scrolledwindow: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Matthias Clasen
fee33b1a81 Clean up private headers
This commit adds a few missing private headers, and cleans up
some irregularities in the existing ones
2014-04-05 02:06:29 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
326da2da58 docs: don't use <anchor> 2014-02-07 15:40:52 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
0ce016650b docs: Use markup for links 2014-02-07 09:42:12 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
2c4431e6ba docs: don't use <keycap> tags 2014-02-04 19:29:00 -05:00
Tristan Van Berkom
07d6c69128 bgo #721407 - Fix scrolled window to work with template subclasses.
Ensure the hscrollbar & vscrollbar at gtk_scrolled_window_add() time,
this allows one to subclass GtkScrolledWindow with templates and add
children, as this will happen at instance initialization time before
the construct adjustment properties take effect.
2014-01-04 20:36:17 -05:00
Bastien Nocera
255fafb891 GtkScrolledWindow: Disconnect from frame clock properly
The tick callback IDs from GtkWidget aren't timeouts, so
use the correct function to disconnect from them.

Spotted by Benjamin Otte <otte@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=710666
2013-10-23 15:22:31 +02:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
William Jon McCann
6e028767d0 Fix default value of scrolled window placement-set property
To make the testsuite happy.
2013-06-26 22:07:00 -04:00
William Jon McCann
e7b5be93b1 Deprecate and ignore gtk-scrolled-window-placement
Just use GTK_CORNER_TOP_LEFT and allow it to be changed with
gtk_scrolled_window_set_placement().
2013-06-26 13:06:12 -04:00
Alexander Larsson
17c559c429 GtkScrollableWindow: Automatically set focus adjustments
When adding with a viewport we automatically set the focus
adjustments on the viewport from the scrolled window, so that
when any child widget gets focused we automatically scroll to it.

This is generally nice, but its particularly important for GtkListBox
where focus changing is how we navigate between rows.

We also ensure that the adjustments are always set before adding the
child to the viewport, which we will need later to pick up the
adjustments on add.
2013-06-13 12:17:06 +02:00
Tristan Van Berkom
c6ab515735 Deprecate gtk_widget_push_composite_child & friends
Deprecate gtk_widget_push_composite_child, gtk_widget_pop_composite_child,
gtk_widget_set_composite_name, gtk_widget_get_composite_name.

This API is just bloat and was never useful, this patch deprecates
it and removes all internal calls to the composite child APIs
2013-04-08 21:19:27 +09:00
Owen W. Taylor
ecddf94f43 GtkScrolledWindow: use gtk_widget_add_tick_callback()
This is slightly simpler and more robust than direct use of
GdkFrameClock.
2013-02-15 22:28:46 -05:00
Owen W. Taylor
05386b44e0 GtkScrolledWindow: use GdkFrameClock for kinetic scrolling
Use GdkFrameClock when animating scrolling via touch, rather
than a timeout.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:49 -05:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
Cosimo Cecchi
8099f864c3 scrolled-window: fix an incorrect gtk-doc comment 2013-02-02 14:08:14 +01:00
Cosimo Cecchi
ad70142d2c scrolledwindow: deprecate gtk_scrolled_window_add_with_viewport()
https://bugzilla.gnome.org/show_bug.cgi?id=693015
2013-02-01 22:58:55 -05:00