Commit Graph

322 Commits

Author SHA1 Message Date
Matthias Clasen
31bf9da63a Strip const from GdkEvent
Events are refcounted structs, and we generally don't
pass these as const.
2020-02-21 00:51:02 -05:00
Timm Bäder
655711fef2 Rename gtk_widget{get,set,has}_style_class to _css_class
We want to use css instead of style everywhere now.
2020-02-07 13:16:45 -05:00
Timm Bäder
b7ee2cbc28 Start using GtkWidget's new style class API 2020-02-07 13:16:32 -05:00
Benjamin Otte
546a748cd8 widget: Replace style-updated signal with css_changed vfunc
1. Rename the thing
2. Turn it from a signal to a vfunc
3. Pass the GtkCssStyleChange to it

We don't export any public API about the GtkCssStyleChange yet, it's
just a boring opaque struct.
2020-02-05 02:46:13 +01:00
Matthias Clasen
2ee04ee8ed GtkPaned: Pay attention to style changes
Make GtkPaned redraw and resize when style change
require it.
2020-01-24 20:55:42 -05:00
Matthias Clasen
112aed590f Remove builtin icons altogether
This removes support for GtkCssImageBuiltin and
GtkCssImageBuiltinType from everywhere.
2020-01-10 14:34:56 -05:00
Matthias Clasen
7447abb52b Stop using gtk_widget_get_toplevel
All uses of it can be replaced by gtk_widget_get_root.
2019-05-28 20:25:16 +00:00
Matthias Clasen
948347afa9 Stop using gtk_widget_is_toplevel 2019-05-28 20:25:16 +00:00
Matthias Clasen
18788c2a86 Remove gtk_widget_get/set_has_surface
These serve no purpose anymore - widgets don't
have surfaces, unless they're a GtkNative.
2019-05-28 20:25:15 +00:00
Matthias Clasen
749c9720ce paned: Make final 2019-05-27 03:25:34 +00:00
Matthias Clasen
d9cf0ff684 paned: Drop the pick vfunc
Implement contains on the handle, instead of pick on the paned.
2019-04-07 16:03:27 +00:00
Matthias Clasen
5b78a3048f gizmo: Add a contains_func
Let GtkGizmo override the contains() implementation.
Update all callers to pass NULL for the contains_func.
2019-04-07 15:47:24 +00:00
Matthias Clasen
a26f400576 paned: Stop using child properties 2019-04-05 12:01:43 +00:00
Carlos Garnacho
c9839b2069 paned: Set cursor on gizmo widget
We may avoid setting it on the paned widget depending on the pointer
position altogether, since the handle is now a widget. Also is more
likely to be correct as the implicitly grabbed widget will probably
be that one.

Fixes the paned losing the resize cursor after button press.
2019-04-03 13:26:40 +02:00
Matthias Clasen
26de69eaae paned: Replace the child properties
Replace the resize and shrink child properties
by resize-child1/2 and shrink-child1/2 properties.
2019-03-27 21:48:12 -04:00
Benjamin Otte
8fb797866d paned: hide the handle widget when <2 children are visible 2019-03-19 08:48:50 +01:00
Benjamin Otte
96a677e5ca paned: Refactor
Don't call a useless function, call gtk_widget_set_child_visible()
directly.
2019-03-19 08:48:41 +01:00
Matthias Clasen
1196380f28 paned: Don't use a grab
It does not seem necessary for proper functioning
of the drag handle.
2019-03-17 18:55:00 -04:00
Matthias Clasen
2bf1561b48 Port widgets to the root focus API 2019-03-16 21:24:44 -04:00
Benjamin Otte
01f7f255b5 gtk: Check return value of compute_bounds()
Half of these calls will completely break if anybody ever uses CSS
transforms with them, but hey...
2019-02-20 05:26:31 +01:00
Timm Bäder
0739399766 paned: Implement increased handle area using pick()
Otherwise, we do report the widgets below the invisible handle area as
hovered or active.
2019-02-16 11:19:29 +01:00
Benjamin Otte
c07cd23aa9 paned: Use gtk_widget_set_overflow() 2019-02-08 18:26:42 +01:00
Timm Bäder
131e8d8905 Remove some unnecessary gtkwindow.h includes 2019-02-05 08:11:43 -05:00
Timm Bäder
c49cc977fa gizmo: return void from snapshot func
This boolean return was from the old gadget code and we weren't using it
in the new gizmo code.
2019-01-18 19:43:50 +01:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Timm Bäder
9fbcbc55d7 Revert "paned: Use a GtkIcon as separator"
This reverts commit 749ef4d71c.

The GtkIcon and GtkGizmo measure code is different, the former uses
-gtk-icon-size.
2018-08-27 18:55:31 +02:00
Timm Bäder
749ef4d71c paned: Use a GtkIcon as separator
And save a few lines that way.
2018-08-25 08:06:11 +02:00
Timm Bäder
2d6955285c paned: Allocation x/y are always 0
The allocation position we get passed to size_allocate is always 0/0
these days.
2018-06-18 17:35:03 +02:00
Timm Bäder
10a0d6252e paned: Remove handle_pos member
Query the handle bounds on demand instead.
2018-06-18 17:35:03 +02:00
Timm Bäder
f8ddc42638 paned: Chain up in snapshot
No need to snapshot all child widgets ourselves, the implementation in
GtkWidget can just do it for us.
2018-06-18 17:35:02 +02:00
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