Commit Graph

292 Commits

Author SHA1 Message Date
Timm Bäder
e9a9bb069f paned: Remove unnecessary local variable
We can just pass the given allocation on.
2018-06-18 17:35:02 +02:00
Timm Bäder
df79f02310 paned: Don't unnecessarily redraw handle in size_allocate
We size_allocate it after all, which will redraw it.
2018-06-18 17:35:02 +02:00
Timm Bäder
bd99ca2f04 paned: Store GParamSpecs
So we can use the more efficient g_object_notify_by_pspec everywhere.
2018-06-18 17:35:02 +02:00
Timm Bäder
da27627696 paned: Don't reorder css nodes based on text direction 2018-06-18 17:35:02 +02:00
Benjamin Otte
4f3058f195 eventcontrollermotion: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
1e6eb1f8b9 draggesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
71991270b0 pangesture: Port to new API model 2018-04-26 17:59:41 +02:00
Benjamin Otte
73b4a62f51 snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
2018-04-24 04:06:58 +02:00
Timm Bäder
1195bb3872 paned: Remove outdated comment
The cursor is not updated in state_flags_changed these days.
2018-04-14 12:50:17 +02:00
Timm Bäder
3ce6355bf4 widget: Remove _get_own_allocation
Replace all usages of it with _compute_bounds
2018-04-10 09:43:47 +02:00
Benjamin Otte
169203951b widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
2018-04-05 14:56:38 +02:00
Benjamin Otte
73650c6da2 gtk: Remove gtk_widget_queue_draw_region()
... and gtk_widget_queue_draw_area().

They don't doi anything anymore.
2018-04-05 14:56:38 +02:00
Alexander Larsson
695d141f32 Merge branch 'rename-window-to-surface' into 'master'
Rename window to surface

See merge request GNOME/gtk!72
2018-03-20 16:16:57 +00:00
Alexander Larsson
63e060a21d GtkWidget: Start renaming widget->window
This is an automated change doing these command:

git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface

git checkout NEWS*
2018-03-20 15:21:12 +01:00
Timm Bäder
c8b0c55284 paned: Remove priv pointer 2018-03-20 09:37:59 +01:00
Benjamin Otte
3bb95a09bb a11y: Remove gtk.h include from container accessible 2018-02-09 00:42:38 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Matthias Clasen
c3851c5469 paned: Stop using motion notify
We can use the new motion event controller that
was introduced for this purpose.
2017-12-12 09:42:05 -05:00
Matthias Clasen
e7ed7c1913 paned: Grab during the drag
This is necessary to ensure we get the right cursor.
2017-12-08 21:09:24 -05:00
Timm Bäder
49e624bbe9 paned: Restrict picking to allocation
Same reason as GtkViewport does it: We might allocate child widgets
outside of the paned's content allocation. For drawing, we add a clip
node.

This was causing the "Record" button in the inspector recorder to ignore
pointer events since the treeview column header label in the GtkPaned
was swallowing it.
2017-12-06 08:23:03 +01:00
Timm Bäder
93df23d962 Remove some more gtk_widget_get_content_size uses 2017-12-04 12:42:52 +01:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -05:00
Benjamin Otte
a409320cda gtk: Use gtk_widget_set_cursor()
... and gtk_widget_set_cursor_from_name() instead of setting cursors on
GdkWindows.
2017-11-04 01:37:03 +01:00
Benjamin Otte
9323d098a6 gdk: Cursors no longer have a display
Change constructors to reflect that.

While doing so, also add a fallback argument to the cursor constructors,
so it is now possible to create cursors with fallback.
2017-11-04 00:07:13 +01:00
Timm Bäder
657983cfda Don't try to snapshot invisible icons
These spew criticals when width == 0 || height == 0.
2017-10-10 09:49:35 +02:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Carlos Garnacho
e6349c940e paned: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Timm Bäder
5f859a1f24 widget: Remove gtk_widget_get_content_allocation
Replace it where we still need something similar, e.g. in
gtk_widget_translate_coordinates
2017-08-14 12:22:39 +02:00
Timm Bäder
36ab70ddf5 widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well
change the size-allocate signature to include a out_clip parameter, just
like GtkCssGadget did. And since we now always propagate baselines, we
might as well pass that one on to size-allocate.

This way we can also make sure to transform the clip returned from
size-allocate to parent-coordinates, i.e. the same coordinate space
priv->allocation is in.
2017-07-19 21:27:16 -04:00
Timm Bäder
6f7387cd25 paned: Fix clip node coordinates 2017-07-19 21:27:15 -04:00
Timm Bäder
a9f10a2d56 paned: Remove assertion in get_child_property
Passing the third child (the pane separator) is possible and shouldn't
cause the process to abort.
2017-07-19 21:27:14 -04:00
Timm Bäder
e501bc6028 paned: Draw handle separator at the right location 2017-07-19 21:27:14 -04:00
Timm Bäder
5228e018b6 paned: Make sure we set the correct clips
They are still too big, i.e. clipped-off children enlarge the paned's
clip but at least redrawing works and smaller clips are just an
optimization.
2017-07-19 21:27:14 -04:00
Timm Bäder
fa97b270f1 paned: Remove useless queue_resize calls
This is done by gtk_widget_unparent nowadays
2017-07-19 21:27:13 -04:00
Timm Bäder
4a4897a9b6 paned: Reimplement handle dragging 2017-07-19 21:27:13 -04:00
Timm Bäder
ac1d3cb396 paned: Replace handle gadget with widget 2017-07-19 21:27:13 -04:00
Timm Bäder
49476053e3 paned: Remove gadget 2017-07-19 21:27:12 -04:00
Timm Bäder
dc9ac96b39 paned: Remove css box drawing 2017-07-19 21:27:11 -04:00
Carlos Garnacho
94094611bc gtkpaned: Remove per-child windows
Those are no longer necessary for clipping nor receiving events, so just
remove them.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
a72404dd5a gtk: Mass delete all GtkWidget event mask API
We now rely on toplevels receiving and forwarding all the events
the windowing should be able to handle. Event masks are no longer a
way to determine whether an event is deliverable ot a widget.

Events will always be delivered in the three captured/target/bubbled
phases, widgets can now just attach GtkEventControllers and let those
handle the events.
2017-05-25 16:25:58 +02:00
Timm Bäder
f053a63d74 container: Remove include_internals parameter from forall
with include_internals=TRUE, this is the same as the (still private)
gtk_widget_forall, or just using the children/sibling accessors in a
loop.
2017-04-25 20:30:37 +02:00
Timm Bäder
ccdc50e540 paned: Fix typo 2017-04-24 15:16:15 +02:00
Timm Bäder
43cdeee3c4 widget: Save pointer to focus child
Do the same thing GtkContainer does.
2017-03-31 09:50:39 +02:00
Timm Bäder
8165b641cd paned: Use gtk_widget_measure to measure widget sizes 2017-02-17 18:23:10 +01:00
Benjamin Otte
87497ca2e1 snapshot: Rename gtk_snapshot_translate_2d()
It's now called gtk_snapshot_offset().
2017-01-13 14:37:48 +01:00
Benjamin Otte
b58de2d16c snapshot: Redo pop() API
gtk_snapshot_pop() => removed
gtk_snapshot_pop_and_append() => gtk_snapshot_pop()

So now there is no way to get a rendernode out of the snapshotting API
until you gtk_snapshot_finish().
2017-01-13 03:38:36 +01:00
Timm Bäder
47d4ad71fb Remove gtk_container_snapshot_child
Replace it with the already existing gtk_widget_snapshot_child.
2017-01-07 17:19:30 +01:00
Benjamin Otte
0dbdf0c428 gadget: Remove gtk_css_gadget_draw()
And with it, remove the draw func from custom gadgets, that has been
NULL everywhere.

All gadgets are snapshot now.
2016-12-20 18:01:12 +01:00
Benjamin Otte
e492a63e4c paned: Implement snapshot() 2016-12-20 18:01:11 +01:00
Piotr Drąg
a2da4ddceb Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00