Commit Graph

20605 Commits

Author SHA1 Message Date
Matthias Clasen
73ff6a8e0f Revert "Better resize of expandable columns"
This reverts commit 0050d469b5.

Conflicts:
	gtk/gtktreeview.c
2014-06-01 10:19:14 -04:00
Matthias Clasen
fd62353e25 Avoid another revert conflict
Moving this bit up a few lines lets the following revert apply
cleanly.
2014-06-01 10:18:38 -04:00
Matthias Clasen
210453b79e Revert "treeview: Remove unneeded checks"
This reverts commit a158a2aa48.

The commit conflicts with a later revert, so move it out of the way.
2014-06-01 10:17:59 -04:00
Carlos Garnacho
995b6d1fd4 textview: Only trigger drag gesture on GDK_BUTTON_PRIMARY
This gesture was only meant to react on GDK_BUTTON_PRIMARY (either
through real pointer events, or implicitly assumed from touch events),
as it used to behave before gestures. Otherwise the gtk_drag_begin*()
call assumes being triggered by button 1, and the drag misbehaves
because that button isn't really in the state mask.

https://bugzilla.gnome.org/show_bug.cgi?id=731016
2014-05-31 15:11:05 +02:00
Matthias Clasen
921b6519f1 inspector: better type detection for resources
Pass the name to g_content_type_guess. With this, most
CSS gets sniffed as C source code.
2014-05-30 23:45:11 -04:00
Matthias Clasen
e4ba5b6ab6 inspector: Go to the right tab when changing objects
When going from attribute mapping to model, it makes most sense
to go directly to the data tab, and when going from an action
name to the owner, we want to show the actions tab. Make it so.
2014-05-30 23:22:29 -04:00
Matthias Clasen
5ed6653859 inspector: Allow jumping to actions
The property editor for action-name properties now offers
to go to the object where the action is defined.
2014-05-30 23:22:29 -04:00
Matthias Clasen
d33ff810cc inspector: Trivial string change
'Size Groups' looks better than 'Sizegroups'.
2014-05-30 23:22:29 -04:00
Debarshi Ray
047d2b5f6d Update GtkImage icons when the direction is changed
Don't call gtk_widget_set_state_flags(), it filters the direction flags.
Instead, call gtk_widget_update_state_flags() directly.

https://bugzilla.gnome.org/show_bug.cgi?id=730833
2014-05-31 05:19:41 +02:00
Benjamin Otte
3df52ae6d5 builder: Cleanup
Use the usual way of providing user data to vfuncs:
- Don't allocate it, use the stack
- Use CamelCase for naming the struct
2014-05-31 05:19:40 +02:00
Matthias Clasen
bb9bf4b408 inspector: Handle attribute mapping changes better
When the mapping is changed, notify the property and
queue a draw on the widget. This makes both the inspector
and the app update their display.
2014-05-30 21:56:07 -04:00
Matthias Clasen
2e4c87038e inspector: some code reshuffling 2014-05-30 21:35:39 -04:00
Matthias Clasen
6a9ea3487e inspector: Support saving CSS
We have a file chooser, lets use it.
2014-05-30 20:35:43 -04:00
Matthias Clasen
eec1bc7ed1 GtkPrintUnixDialog: Remove some dead code
Automatic template children get cleaned up and NULLed out in destroy,
the g_clear_pointer() calls in finalize never do anything.
2014-05-30 19:33:11 -04:00
Evan Nemerson
54ec42f035 gtk: port many nullability annotation fixes from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-30 13:24:20 -07:00
Matthias Clasen
4d1930cf74 Make notebook content redraw during drag
The extra condition here that caused the current child to
not redraw during reordering was introduced in f383e1f1
during the port to ::draw, but was not explained in the
commit message, and removing it has no obvious negative
effect.

https://bugzilla.gnome.org/show_bug.cgi?id=730767
2014-05-30 13:39:27 -04:00
Matthias Clasen
6de6656d1f GtkBuilder: Ensure types are fully initialized
Just calling get_type() does not ensure that the signals, properties
and everything else gets set up properly. Ensure it is, by calling
g_type_class_ref() before using the type. This fixes the testcase
added in the previous commit.
2014-05-30 12:39:07 -04:00
Matthias Clasen
1af5f6d507 GtkActionable: Update the docs
Actionable is no longer restricted to "app" and "win" actions.
2014-05-30 07:05:50 -04: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
Matthias Clasen
489b59867c Revert "GtkMisc: Keep gtk_misc_set_alignment working"
This reverts commit aabc356b80.

Labels are back to looking at x/yalign (for now).
2014-05-29 10:32:46 -04:00
Carlos Garnacho
618e3d3157 eventcontroller: Ensure controllers stay alive during event emission
Those might trigger the destruction of some widget that would dispose the
event controller while the event is still being handled, so keep an extra
ref on the controller during event processing.
2014-05-28 19:39:07 +02:00
Evan Nemerson
9db729f5a6 gtk: fix several out argument annotations
These mostly just switch from allow-none to optional, nullable, or
both, as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:33 -07:00
Evan Nemerson
a77765f172 gtk: add missing ownership annotations ported from Vala
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:33 -07:00
Evan Nemerson
07d825574f gtk: add missing type annotations ported from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:33 -07:00
Evan Nemerson
bda145b19f gtk: fix annotation syntax and missing some missing annotations
These changes clean up various errors and omissions resulting from
either slightly incorrect G-I/gtk-doc syntax or missing documentation
blocks.

https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:32 -07:00
Evan Nemerson
e596e58c51 gtk: port missing array annotations from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:32 -07:00
Evan Nemerson
e568903360 gtk: fix many callback annotations to include closure information
Without this information introspection-based consumers don't realize
they can include context information, but instead think that they
receive an extra gpointer argument (which they don't know how to
handle).

https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:32 -07:00
Matthias Clasen
a28d2cb923 Move extract-strings to its own directory
This will hopefully help resolve the circular dependency between
libgtk linking against inspector/libgtkinspector and inspector/
needing extract-strings from gtk/.

I didn't preserve the EXEEXT decorations in this operation -
automake gave me stern warnings about it, so I just dropped them
all. Somebody who cross-builds GTK+ will have to reconstruct this.
2014-05-27 17:28:10 -04:00
Matthias Clasen
ea2d20e313 Fix distcheck 2014-05-27 15:14:02 -04:00
Matthias Clasen
3bb404f40c Don't assert in gtk_event_controller_constructed
This prevents some of our generic object implementation tests
from working with gesture objects. Instead, add g_return_if_fail
checks in all the gesture constructors.
2014-05-27 14:33:32 -04:00
Matthias Clasen
e4680d64a0 Documentation fixes
Add a few missing symbols, and match up parameters in headers
and doc comments.
2014-05-27 14:33:32 -04:00
Matthias Clasen
4ce2f3e769 Silence gtk-doc warnings 2014-05-27 13:17:34 -04:00
Matthias Clasen
7fa0228755 Revert "GtkImage: Drop use of GtkMisc::x/yalign"
This reverts commit 54d5b426fc.

Conflicts:
	gtk/gtkimage.c
2014-05-27 13:08:25 -04:00
Matthias Clasen
24863a0b6a Revert "GtkLabel: Drop use of GtkMisc::x/yalign"
This reverts commit b320c198b6.
2014-05-27 13:07:03 -04:00
Matthias Clasen
6ce2a8fb13 Revert "Fix up GtkLabel and GtkImage sizing"
This reverts commit 3b30cfa344.
2014-05-27 13:04:43 -04:00
Matthias Clasen
7c83a71239 Revert "More label and image sizing fixes"
This reverts commit 68c1e83cf0.
2014-05-27 13:04:34 -04:00
Carlos Garnacho
d9bdb9a137 window: Do not raise border windows on each size allocation
This prevents these windows from being raised above popovers, which
is about the only child widget that may overlap with those anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=730589
2014-05-27 17:56:59 +02:00
Carlos Garnacho
4cf111aab3 treeview: Make the multipress gesture listen only to bin_window
This gesture is meant to handle row-activated signaling, so make the
gesture ignore events from any other window.
2014-05-27 17:47:13 +02:00
Carlos Garnacho
2012b67c5b button: Claim the sequence on multipress::pressed
In order to avoid the event from bubbling, as it used to (not) do.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
e0fd901722 gesture: Fix wrong assert in gtk_gesture_set_window
The window must be part of the event controller widget, so
fix the inverted logic.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
49a6626884 eventcontroller: Hide more details
Signals are left hidden, so the only entry point to handle_event/reset
is API.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
907e9f1946 gtk: Update GtkGesture users to the GtkPropagationPhase semantics change
Mainly doing s/TARGET/BUBBLE/ on the fully ported widgets, but GtkTreeView
where the double click handler has moved to GTK_PHASE_TARGET so it runs
parallelly to the still existing event handlers.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
505efbb3f3 widget: Change GtkCapturePhase behavior in event controllers' handling
Previously, there would be globally just a capture and a bubble phase,
with the event just going down the hierarchy once, and the up once.
GTK_PHASE_TARGET actually meaning "run within event handlers", so in
a hierarchy of 3 widgets, emission would be:

  Capture(C)
  Capture(B)
  Capture(A)
  Target(A) (if event handlers allow)
  Bubble(A)
  Target(B) (if event handlers allow)
  Bubble(B)
  Target(C) (if event handlers allow)
  Bubble(C)

This commit changes this behavior and uses GTK_PHASE_TARGET in a less
misleading way, running only on the widget that was meant to receive
the event. And GTK_PHASE_BUBBLE has taken over the execution place of
GTK_PHASE_TARGET, so the emission remains:

  Capture(C)
  Capture(B)
  Capture(A)
  Target(A)
  Bubble(A) (if event handlers allow)
  Bubble(B) (...)
  Bubble(C) (...)

As it was, GTK_PHASE_BUBBLE was useful for running event controllers
paralelly to event handlers, without modifying a single line in those.
For those mixed scenarios, Any of the other phases will have to be
used at discretion, or the event handlers eventually changed to chain
up and let the default event handlers in GtkWidget to be run.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
a8e833dc5c window: Avoid double event processing in the multipress event controller
The events to those are fed outside the regular event propagation scheme,
through _gtk_window_check_handle_wm_event(), so set the controller to
GTK_PHASE_NONE so events aren't processed first manually, and then
automatically.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
9f8bd7a2bc gesturezoom: Just return a double in get_scale_delta()
Checking whether the gesture is active is a responsibility of the caller.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
8f7d5fb2c0 gesturerotate: Just return a double in get_angle_delta()
Whether the gesture is active or recognized should be checked before in
callers, or just not used naively.
2014-05-27 17:47:12 +02: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
2e903243c6 eventcontroller: Make the event-mask property and methods private.
This will rarely have any use if no subclassing is allowed, so just make it
private for our own.
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