Matthias Clasen
9b165c8bec
treeview: Use a popover for search
...
This is a more modern way of doing things, and avoids a window
of type GTK_WINDOW_POPUP. With a popover, it doesn't make sense
to have a positioning function, so remove that api.
2019-12-29 20:31:58 -05:00
Matthias Clasen
87502b4f2e
Fix the build
2019-12-24 09:58:56 -05:00
Matthias Clasen
3644d3a100
Merge branch 'gtk-demo-fixes' into 'master'
...
Gtk demo fixes
See merge request GNOME/gtk!1266
2019-12-24 08:47:28 +00:00
Matthias Clasen
9e3147f78d
treeview: Fix embedding cell renderers
...
We need to manually set up the css node,
since the treeview has children whose css
node is not a direct child of the treeview
css node (header buttons).
2019-12-24 03:39:02 -05:00
Peter Bloomfield
46d960ddfd
tree-view: Drop GtkTreeViewPrivate
...
GtkTreeView is now private, so it doesn't need an instance-private
structure.
2019-12-15 19:19:42 -05:00
Benjamin Otte
dff86c0e12
eventcontrollermotion: Add getters for the properties
...
... and use them.
Also, rename them from is/contains-pointer-focus to is/contains-pointer,
that's clear enough and not too long.
Finally, adapt the semantics of contains-pointer to mirror
GtkEventControllerKey::contains-focus. If is-pointer is set, so is
contains-pointer, they are not exclusive.
Which is what all users of this property wanted, too.
2019-12-15 21:07:54 +01:00
Benjamin Otte
d3e8678955
treeview: Don't create a cyclic reference
...
TreeRowReference refs the proxy object, so don't use proxies.
2019-12-09 16:35:41 +01:00
Benjamin Otte
427deb4f13
widget: Make gtk_widget_grab_focus() return a boolean
...
So now it can actually fail.
It doesn't yet though.
2019-10-15 16:33:05 +02:00
Benjamin Otte
a3cfb42888
eventcontrollerkey: Change behavior of contains-focus
...
contains-focus now returns TRUE when is-focus is TRUE instead of FALSE.
Fixes #2184
2019-10-07 04:49:50 +02:00
Benjamin Otte
578dc9e70b
eventcontrollerkey: Add getters for the properties
...
...and use them.
2019-10-07 04:49:50 +02:00
Timm Bäder
8d1a2247e0
treeview: Redo tree line drawing using textures
...
Gets rid of the remaining cairo nodes used for line drawing.
2019-08-11 09:05:28 +02:00
Timm Bäder
4fba7f8c59
treeview: Redo grid line drawing using textures
...
The cairo pattern in use was simple enough, so just use a 2×1 or 1×2
texture to draw horizontal and vertical grid lines. This avoids a bunch
of cairo nodes (that can't be cached by the renderers).
2019-08-11 09:05:25 +02:00
Timm Bäder
b812ff2597
treeview: Shorten destroy() implementation
2019-08-10 19:51:45 +02:00
Timm Bäder
8a51796150
treeview: Remove two _dashes members
...
Tree lines and grid lines always look the same these days.
2019-08-10 19:51:45 +02:00
Timm Bäder
dd7d171186
treeview: Remove GTK_TREE_VIEW_FOREGROUND_LINE
2019-08-10 19:51:45 +02:00
Timm Bäder
fd201e4df7
treeviewcolumn: Remove cell_area parameter from _cell_get_size
...
Fixes #297
2019-08-09 17:04:58 +02:00
Timm Bäder
264d4bada6
widget: Remove queue_resize_no_redraw
...
We always invalidate the widget in size_allocate() anyway.
2019-07-07 07:43:08 +02:00
Matthias Clasen
10ce2076f9
treeview: Stop disabling the context menu
2019-06-13 11:59:51 +00:00
Christian Hergert
828c36636c
va_marshaller: add various va_marshallers
...
We don't need to cover every case with a va_marshaller, but there are a
number of them that are useful because they will often only be connected
to by a single signal handler.
Generally speaking, if I opened into a file to add a va_marshaller, I just
set all of them.
2019-06-06 15:30:42 -07: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
79940b32b5
treeview: Make final
...
Make GtkTreeSelection final as well.
2019-05-28 21:42:38 -04: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
302d2a04ae
Stop using gtk_widget_get_surface
...
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
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
Timm Bäder
929cdd9259
treeview: Don't always grab_focus() when moving the cursor
...
This doesn't really make sense, we can assume that the treeview already
has the focus when it receives key events.
2019-04-28 11:26:40 +02:00
Timm Bäder
1e16cb088a
treeview: Always update expand when allocating columns
...
It doesn't make sense to keep track of all the last_* values anymore now
that widgets only get allocated when their size changes anyway.
Remove all the associated (and thus now unused) flags as well.
2019-04-28 06:54:10 +02:00
Timm Bäder
f4cf43359d
treeview: Remove a useless check
2019-04-28 06:50:57 +02:00
Timm Bäder
6c8a5f5e2f
treeview: Remove unused member
2019-04-28 06:45:33 +02:00
Matthias Clasen
8af0782261
treeview: Make expanders work again
...
These were broken by the crossing event unification.
We are now generating some more crossing events, and
the treeview was not looking closely enough at the
ones it gets.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1814
2019-04-07 12:16:20 +00:00
Carlos Garnacho
95754aa71f
treeview: Fix variable typo
...
We actually want search_entry there, not search_window which is the
O-R window in the non-custom case.
2019-04-03 13:07:06 +02:00
Matthias Clasen
2d10a7b9c4
gtk: Stop using gdk_surface_get_device_position
...
Use the double version directly.
2019-03-26 18:08:32 -04:00
Matthias Clasen
6f072c80db
treeview: Stop using gtk_window_move
...
It is going away. The search popup needs to be
redone using popovers.
2019-03-26 17:55:29 -04:00
Matthias Clasen
8650980797
Adapt to motion controller api change
...
The signature of the enter/leave signals changed.
Adapt all users.
2019-03-18 09:24:42 -04:00
Matthias Clasen
921eccb459
Pass mode and detail to focus-in/out signals
...
This information is useful when maintaining a
'last focus' field.
Update all users.
2019-03-16 21:24:45 -04:00
Matthias Clasen
7819a5aab9
Drop gtk_widget_send_focus_change
...
Replace this with gtk_widget_set_has_focus + gtk_widget_event.
2019-03-16 21:24:44 -04:00
Christoph Reiter
348912dff4
treeview: make sure separator nodes have a height > 0
...
In case the theme doesn't set a height/min-height for the treeview
separator the treeview drawing gets confused and draws rows on top of each
other depending on the redraw area.
This is due to gtk_tree_view_get_row_height() assuming that a node with a
height <= 0 is not set and not a separator and it will default to the
expander size.
Ideally gtk_tree_view_get_row_height() would know if it operates on a separator,
but there are too many calls/levels, so just make sure the separator height
is at least 1 (Adwaita already sets "min-height: 2px", so no change there)
Cherry-picked from !614 to master
2019-03-04 17:07:13 +01:00
Matthias Clasen
9e0c471b03
entry, spin button: Drop redundant API
...
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00
Matthias Clasen
fda4546de5
treeview: Stop using set_focus_child
...
Do this with an event controller on the buttons instead.
2019-02-28 00:36:44 -05:00
Timm Bäder
e54ce8f328
treeview: Don't assume search widget is a GtkEntry
...
Maybe it's a GtkText!
2019-02-23 04:42:01 +01:00
Benjamin Otte
5fc446dabf
treeview: Use new snapshot transforms
2019-02-21 19:47:28 +01:00
Matthias Clasen
3a1a7c43f3
treeview: make search work
...
Make search work with both GtkEntry and GtkSearchEntry,
even if a GtkSearchEntry is not derived from GtkEntry
anymore.
2019-02-19 00:25:59 -05:00
Matthias Clasen
cbbc7dd70f
treeview: use a GtkText as search entry
2019-02-19 00:25:59 -05:00
Matthias Clasen
a31da76f95
treeview: Disable some search entry functionality
...
This needs to be rewritten. Until then, keep it limping along.
2019-02-19 00:25:59 -05:00
Benjamin Otte
3d05e6777a
treeview: Use gtk_widget_set_overflow()
...
We need to clip again so we don't overdraw the headers, but setting
overflow does the right thing with header widgetry.
2019-02-08 18:26:42 +01: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
7dd54b5789
treeview: Don't get separator_height more than once
...
Closes !209
2019-01-16 18:58:15 +01:00
Timm Bäder
697aa95c7e
treeview: cache expander size
...
We need to know it all the time and since we get it from CSS, doing that
is fairly expensive.
2019-01-16 18:58:15 +01:00
Matthias Clasen
e269f43afc
Rename GtkRBTree to GtkTreeRBTree
...
This frees up the generic name for a more
generic rbtree implementation.
2019-01-14 02:14:11 +01:00
Christoph Reiter
b061821f24
g-i: Add some nullable annotations
...
Based on grepping arg docs for NULL.
See https://gitlab.gnome.org/GNOME/pygobject/issues/261
2018-11-18 13:36: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