Commit Graph

207 Commits

Author SHA1 Message Date
Matthias Clasen
1b44a64ef7 expander: Use dispose instead of destroy
The destroy vfunc is going away.
2020-05-05 18:23:53 -04:00
Matthias Clasen
b55195fa2e Move the idle sizer to GtkWindow
This was only living in gtkcontainer.c for historic
reasons. Move it closer to where it belongs, and
rename it from 'idle' to 'layout', since it is
really about the layout phase of the frame clock,
nowadays.
2020-04-20 16:30:45 -04:00
Matthias Clasen
9f5955e1b1 expander: Drop the Private struct 2020-04-13 20:04:32 -04:00
Matthias Clasen
632524f679 Reinstate expected focus behavior
After the :can-focus change in the previous commit, widgets
need to set suitable focus and grab_focus implementations
to implement the desired focus behavior.

This commit does that for all widgets.
2020-04-09 17:50:29 -04:00
Matthias Clasen
22e1827f84 Change the default value of GtkWidget:can-focus
Make widgets can-focus by default, and change the semantics
of can-focus to be recursive . If it is set to FALSE, focus
can not enter the widget or its descendents at all anymore.

This commit temporarily breaks focus behavior of widgets
that did not expect to receive focus.
2020-04-09 17:50:29 -04:00
Benjamin Otte
d680e2e344 Port simple cases to GtkDropControllerMotion 2020-02-22 07:33:40 +01:00
Benjamin Otte
80ba7fd682 dragdest: Make gtk_drop_target_new() args be transfer full
Saves tons of code.
2020-02-17 04:04:21 +01: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
Alexander Larsson
6a15e9169d Rename GtkIcon widget to GtkBuiltinIcon
This is an internal widget whose name is not very important, and we
want to rename GtkIconInfo to GtkIcon, so lets rename this.
2020-01-30 10:53:33 +01:00
Matthias Clasen
ec255f9bb1 Update all callers 2020-01-11 00:50:22 -05:00
Matthias Clasen
1c03bbeb9c Update all users 2020-01-08 18:48:23 -05:00
Matthias Clasen
5206a92522 Update all callers 2020-01-08 18:48:22 -05:00
Matthias Clasen
e9067ae2db Replace gtk_drop_target_attach/detach
Since drop targets are now just event controller,
gtk_widget_add/remove_controller works just fine
for them.
2020-01-08 18:48:21 -05:00
Matthias Clasen
1262184269 droptarget: Drop the track-motion property
It does not have any effect anymore.

Update all callers
2020-01-08 18:48:20 -05:00
Matthias Clasen
46f42fc53d droptarget: Drop defaults flags
These no longer have any effect.

Update all callers.
2020-01-08 18:48:20 -05:00
Matthias Clasen
1e000c3dac Remove gtkdnd.h 2020-01-08 18:48:20 -05:00
Matthias Clasen
b0d9a6ff20 expander: Port to GtkDropTarget 2020-01-08 18:48:20 -05:00
Benjamin Otte
6d20fe0bf9 expander: Rename CSS nodes
The expander icon is renamed from "arrow" to "expander".
The expander widget itself is renamed from "expander" to
"expander-widget" (Better ideas welcome).

This makes it possible to have an "expander" icon in more places then
the GtkExpander widget (in particular in tree lists) and not
confuse it with arrows.
2019-10-15 07:17:07 +02:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00: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
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
53010fd0b3 expander: Make final 2019-05-26 22:50:03 -04:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +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
Benjamin Otte
b00609c21c dnd: Make drag-motion and drag-drop signals use GdkDrop 2018-06-18 23:49:52 +02:00
Benjamin Otte
314eaf7d10 widget: Make GtkWidgetClass::drag_leave() take a GdkDrop
Drag Contexts are on their way out!
2018-06-18 23:49:20 +02:00
Benjamin Otte
4ddc94b293 multipressgesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
9c0acf62b4 widget: Allow adding event controllers in ui files 2018-04-26 17:59:41 +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
Timm Bäder
2f9790b02e expander: Update css docs 2018-03-28 16:42:53 +02:00
Timm Bäder
d0adffe6eb expander: Remove priv pointer 2018-03-28 16:32:46 +02: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
4dfe4a6476 expander: Remove label-fill property
It's just setting some internal boolean and nothing else. It's like this
in gtk3 as well so it can't be too important either.
2018-03-07 20:17:39 +01:00
Peter Bloomfield
a207ab6105 expander: Check for an existing child when adding
Now that GtkExpander subclasses GtkContainer instead of GtkBin, it needs
its own guard against adding more than one child.

Also, the documentation should no longer describe adding a child as if
it is descended from GtkBin.
2018-03-06 14:26:08 -05:00
Timm Bäder
f5e290517a expander: fix sizes in resize_toplevel
We can't use gtk_widget_get_allocation for either non-anchored widgets
(which happens with the child widget when the expander is unexpanded)
nor toplevel windows since that will include the window decorations.

Fixes #70 in gtk4
2018-03-06 18:12:49 +01:00
Timm Bäder
22457822eb expander: Attach the gesture to the title widget
Instead of tracking whether the click happened inside the title widget
ourselves, just attach the gesture to the title widget.
2018-03-05 17:24:22 +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
Emmanuele Bassi
c655759cef Replace gdk_threads_add_timeout* with g_timeout_add()
The main GDK thread lock is not portable and deprecated.

The only reason why gdk_threads_add_timeout() and
gdk_threads_add_timeout_full() exist is to allow invoking a callback
with the GDK lock held, in case 3rd party libraries still use the
deprecated gdk_threads_enter()/gdk_threads_leave() API.

Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing timeout callbacks.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:06:58 +01:00
Timm Bäder
3d9421509c expander: Make a code snippet compile 2018-01-03 17:11:32 +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
5a1a11bcde dnd: Make GtkDragDest and GtkDragSource use GtkTargetList
This gets rid of GtkTargetEntry in the API and consistently uses
GtkTargetList.
2017-11-15 19:07:17 +01:00
Benjamin Otte
e3effc8df2 expander: Don't do :hover yourself
GTK does it for you.
2017-11-05 05:13:17 +01: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
Matthias Clasen
2246387d21 expander: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Daniel Boles
7161b57063 Expander: get_label() return is nullable
Also, use gchar to match the header.
2017-09-15 18:25:47 +01:00
Daniel Boles
89790bb412 Expander: Annotate new()’s label arg as nullable
to match new_with_mnemonic()
2017-09-14 21:21:09 +01:00
Daniel Boles
050531a9f2 Expander: Replace (allow-none) with (nullable)
The former is deprecated in favour of the latter.
2017-09-14 21:21:08 +01:00
Daniel Boles
3cd117e3a1 Expander: Explain how to conditionally style arrow 2017-09-14 21:21:08 +01:00