Commit Graph

20355 Commits

Author SHA1 Message Date
Carlos Garnacho
d89e810bd9 gesture: Only track non denied sequences in get_last_updated_sequence() 2014-05-23 19:54:23 +02:00
Carlos Garnacho
b7435a0290 gesture: cancel all ongoing sequences on reset() 2014-05-23 19:54:23 +02:00
Carlos Garnacho
d2c9b9c2aa gesture: Skip non-device events early. 2014-05-23 19:54:23 +02:00
Carlos Garnacho
25ece22013 gesture: Add gtk_gesture_[sg]et_window()
This can be used to restrict a gesture to an specific GdkWindow,
all events will be checked to happen on/within that window.
2014-05-23 19:54:22 +02:00
Carlos Garnacho
c4944b0376 gesture: Remove the touch-only property
This is handled in GtkGestureSingle.
2014-05-23 19:54:22 +02:00
Carlos Garnacho
d4d0f13c3a Add GtkGestureSingle
This is a GtkGesture subclass, specific to single-touch (or
mouse operated) gestures.
2014-05-23 19:54:22 +02:00
Matthias Clasen
49e9ba122a ...and add the right include instead 2014-05-23 19:54:22 +02:00
Matthias Clasen
a1aeaa6b07 Remove a doubled line 2014-05-23 19:54:22 +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
36106c19d4 widget: Propagate touch/button press events when a sequence is denied
If the captured touch begin or button press event have been consumed
for the given sequence, propagate it upwards if the sequence goes from
claimed to denied, so the widgets on the way to the event widget receive
a coherent event stream now that they're going to receive events.
2014-05-23 19:54:22 +02:00
Carlos Garnacho
83dd050ab2 gesture: Add private getter to know whether a touch begin was handled
If GDK_TOUCH_BEGIN was handled/consumed for a sequence, or GDK_BUTTON_PRESS was
handled for the mouse gesture, this function will return TRUE.
2014-05-23 19:54:22 +02:00
Carlos Garnacho
a9fa0151f1 widget: Implement hierarchy-level mechanism to claim/deny sequences
The policy of sequence states has been made tighter on GtkGesture,
so gestures can never return to a "none" state, nor get out of a
"denied" state, a "claimed" sequence can go "denied" though.

The helper API at the widget level will first emit
GtkWidget::sequence-state-changed on the called widget, and then
notify through the same signal to every other widget in the captured
event chain. So the effect of that signal is twofold, on one hand
it lets the original widget set the state on its attached controllers,
and on the other hand it lets the other widgets freely adapt to the
sequence state changing elsewhere in the event widget chain.

By default, that signal updates every controller on the first usecase,
and propagates the default gesture policy to every other widget in the
chain on the second. This means that, by default:

1) Sequences start out on the "none" state, and get propagated through
   all the event widget chain.
2) If a widget in the chain denies the sequence, all other widgets are
   unaffected.
3) If a widget in the chain claims the sequence, then:
  3.1) Every widget below the claiming widget (ie. towards the event widget)
       will get the sequence cancelled.
  3.2) Every widget above the claiming widget that had the sequence as "none"
       will remain as such, if it was claimed it will go denied, but that should
       rarely happen.

This behavior can be tweaked through the GtkWidget::sequence-state-changed and
GtkGesture::event-handled vmethods, although this should be very rarely done.
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
Carlos Garnacho
76213ab209 widget: Add widget-level handling of touch sequence state.
These functions ATM do nothing but proxying the controller(s) state
with the given sequence.
2014-05-23 19:54:22 +02:00
Carlos Garnacho
f1bb0283dd widget: Hook GtkEventController to widget event processing.
A controller can be optionally hooked on the capture or the bubble
phase, so the controller will automatically receive and handle events
as they arrive without further interaction.
2014-05-23 19:54:22 +02:00
Carlos Garnacho
d0da82fed6 gtk: Remove propagation limit of captured events on the grab widget
Now, all captured events run from the toplevel to the deepmost widget,
regardless of GTK+ grabs. This makes captured events more useful to
event controllers if used together in the hierarchy with widgets doing
old fashioned event handling and GTK+ grabs.
2014-05-23 19:54:22 +02:00
Carlos Garnacho
450c754c7c Add GtkGestureMultiPress
This gesture handles any number of clicks, ensuring multiple presses
stay within thresholds and timeouts. When anything of that happens,
the gesture is reset and press count starts from 1 again.

Optionally, the gesture can be given a rectangle, used in in presses > 1
to ensure the consecutive presses happen on user imposed areas.
2014-05-23 19:54:21 +02:00
Carlos Garnacho
8026bc3651 Add GtkGestureDrag
This gesture interprets and reports drags as an offset to the drag
start point.
2014-05-23 19:54:21 +02:00
Carlos Garnacho
9db3c2d893 Add GtkGestureZoom
This gesture interprets and reports relative scale differences when fed
with events from two different GdkEventSequences.
2014-05-23 19:54:21 +02:00
Carlos Garnacho
2495b518c1 Add GtkGestureRotate
This gesture implementation recognizes rotations when fed with
events from two different GdkEventSequences
2014-05-23 19:54:21 +02:00
Carlos Garnacho
8733e2a918 Add GtkGestureSwipe
This gesture implementation recognices swipes on any direction.
The "swipe" signal has the X/Y velocity vector components, so
those can be used for direction guessing and velocity thresholds.
2014-05-23 19:54:21 +02:00
Carlos Garnacho
88d554d3ba Add GtkGestureLongPress
This gesture interprets long presses with variable delays
and thresholds
2014-05-23 19:54:21 +02:00
Carlos Garnacho
8f113e07fd Add GtkGesture
This a more specific abstract type that handles one or multiple
streams of pointer/touch events.
2014-05-23 19:54:21 +02:00
Carlos Garnacho
e2b8ef8c66 Add GtkEventController
This is a basic abstract type that handles GdkEvents.
2014-05-23 19:54:21 +02:00
Benjamin Otte
6c49ffe916 themingbackground: Outset shadows require border box
They are drawn relative to the border box, not relative to the padding
box.
2014-05-23 19:29:27 +02:00
Benjamin Otte
fa22218973 css: Make getter function a real getter
Initialize the passed-in value, don't treat it as an in-out parameter.
2014-05-23 19:29:27 +02:00
Matthias Clasen
d769f338f2 GtkButton: tighten code a bit
Make it so we only use GtkMisc in one place.
2014-05-22 23:15:08 -04:00
Matthias Clasen
2df80d7a4d inspector: Repeat the keybinding warning
Show the confirmation dialog every time the keybinding is used,
until the user clicks OK.
2014-05-22 18:37:43 -04:00
Matthias Clasen
372e551a66 inspector: avoid a warning on destroy
We are only hiding the window now, so a memory management
error has crept into the destroy path.
2014-05-22 18:37:43 -04:00
Benjamin Otte
e012dfab2c Revert "Fix crash"
This reverts commit 024c11dd66.

It's not a crash fix to cause a return_val_if_fail() to happen.
2014-05-22 22:35:39 +02:00
Behdad Esfahbod
024c11dd66 Fix crash 2014-05-22 15:52:01 -04:00
Matthias Clasen
49cf5142ba Deprecate GdkColor
It has been replaced by GdkRGBA. Time to make it official.
http://bugzilla.gnome.org/show_bug.cgi?id=636695
2014-05-22 09:09:55 -04:00
Matthias Clasen
2036c150ea Avoid a compiler warning 2014-05-22 08:32:48 -04: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
Matthias Clasen
898f0fa0b9 Avoid a critical in the file chooser
Hiding the location entry was causing criticals, because
the completion was updated after the widget has already
been disposed.
https://bugzilla.gnome.org/show_bug.cgi?id=720330
2014-05-21 22:50:48 -04:00
Benjamin Otte
b90802f7e4 css: Actually break at end of the string
Introduced in 65c4c1555d.

Found by gnome-continuous running the testsuite.

Includes fixing a broken test in the testsuite.
2014-05-22 02:13:49 +02:00
Matthias Clasen
9ae12b15e9 GtkAppChooserDialog: Make the search entry wider
It was too narrow, and looked a bit odd.

https://bugzilla.gnome.org/show_bug.cgi?id=727147
2014-05-21 20:11:16 -04:00
Matthias Clasen
e6c050c06f searchbar: Add some spacing
When showing the close button, and placing a wide entry in the
middle, there was no separation at all. Fix this by setting
some spacing.
2014-05-21 20:09:46 -04:00
Matthias Clasen
8591f452f0 ColorChooser: Emit notification for editor changes
When the color editor is visible, there is no way for the
application to know about the changes that are happening.
Fix this by emitting property notification for the "rgba"
property.

http://bugzilla.gnome.org/show_bug.cgi?id=708037
2014-05-21 19:23:56 -04:00
Jasper St. Pierre
0ea1a526f9 gtkwindow: Use window-manager-side window menus
This avoids a bunch of policy problems with deciding how to lay
out the window menu under different WMs.

For now, we use the special event _GTK_SHOW_WINDOW_MENU, but we
hope to have this standardized in wm-spec quite soon, as KDE wants
it as well.
2014-05-21 18:41:07 -04:00
Yosef Or Boczko
02d92ff831 inspector: Use the new support for RTL icons in GtkIconTheme
https://bugzilla.gnome.org/show_bug.cgi?id=730526
2014-05-21 21:07:05 +03:00
Yosef Or Boczko
c543a14c5b Use the new support for RTL icons in GtkIconTheme
https://bugzilla.gnome.org/show_bug.cgi?id=730526
2014-05-21 17:45:38 +03:00
Matthias Clasen
6b26410d38 GtkLabel: Make context menus on links work
We see an active link when creating the menu, but by the time
the menuitem is activated, we've received a leave notify that
makes the label clear its active link. Instead, give the
menuitems a direct reference to the link that is active when
the menu is created.

Problem pointed out by Tim Baedert
2014-05-21 10:29:17 -04:00
Matthias Clasen
11abc517f5 inspector: Avoid weak ref problems
We know the objects in a size group are always widgets, so we
can avoid hard-to-track down problems with weak references by
just cleaning up when the object gets destroyed. There is still
a chance that we show a widget as part of the group after it
has been removed, but size groups simply have no signals that
would let us avoid that.
2014-05-21 06:44:44 -04:00
Matthias Clasen
d39ee6c81c inspector: Simplify object life-cycle handling
The prop-list doesn't use the object column in its model,
so don't put the object there. And don't leak stuff on
finalize.
2014-05-21 06:44:44 -04:00
Matthias Clasen
3d8b0514bb inspector: Use an emission hook instead of signal handlers
This is slightly easier to manage, and there's only two emission
hooks overall, instead of two signal handlers per object.
2014-05-21 06:44:44 -04:00
Matthias Clasen
af8fdac001 inspector: Show size groups
Add a tab that shows size groups of a widget. The properties
of the size group are available here, as well as the widgets
that are part of the size group. We highlight the widgets in
the application when their row in the inspector is hovered.
2014-05-20 21:44:48 -04:00
Matthias Clasen
538b987bc5 inspector: Add a way to highlight widgets
In contrast to the flashing, where we blink the widget a
few times, this is explicitly turned on and off.

It will be used for indicating widgets that are part of
a size group, in the next commit.
2014-05-20 21:43:00 -04:00
Yosef Or Boczko
65c9e2a651 inspector: Use symbolic icon everywhere
https://bugzilla.gnome.org/show_bug.cgi?id=730465
2014-05-20 16:21:28 -04:00