Matthias Clasen
2d914d52be
text: Handle key events in the target phase
...
This makes sure that we do actual key input right
in the middle between all the capture and bubble
event controllers, and are not dependent on the
ordering of those controllers.
The bug that triggered this change was that the
shortcut for activation (Enter) was getting triggered
before the key input, causing Ctrl-Shift-u hex
to stop working, since it never received the enter
to commit the sequence.
2020-06-26 14:08:35 -04:00
Matthias Clasen
a26865e741
widget: Add a debug message for consumed key events
...
Run the application with GTK_DEBUG=keybindings to
get some hints where key events get lost.
2020-06-26 14:08:14 -04:00
Matthias Clasen
3558beaa61
text: Give names to event controllers
...
It helps with debugging.
2020-06-26 14:08:11 -04:00
Matthias Clasen
9b9a9f14e2
Merge branch 'wip/carlosg/sequence-state-fixups' into 'master'
...
Fixups to gesture sequence states
Closes #2895
See merge request GNOME/gtk!2154
2020-06-26 17:08:09 +00:00
Carlos Garnacho
0ce4f66976
gtktext: Don't accept (twice!) all press actions
...
The gesture should claim the sequence after triggering uncancellable
actions, like pasting, showing a menu or selecting words/lines. A
single first button press initiating a drag does not trigger
anything yet, so it should avoid claiming the sequence.
2020-06-26 17:48:10 +02:00
Carlos Garnacho
b81bbde7c8
gtkswitch: Don't be eager in accepting the gesture
...
The gesture should be accepted whenever it triggers uncancellable
actions in the widget. This means it should be accepted if the
click does result in toggling the switch.
This leaves the pan gesture room to handle dragging the handle.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2895
2020-06-26 17:48:10 +02:00
Matthias Clasen
3f55bfe2cb
Merge branch 'matthiasc/for-master' into 'master'
...
main: Avoid a warning
Closes #2894
See merge request GNOME/gtk!2153
2020-06-26 14:31:20 +00:00
Matthias Clasen
4185ba242b
docs: Some tweaks to the list widget overview
2020-06-26 09:05:56 -04:00
Matthias Clasen
e04191a5ea
Merge branch 'wip/otte/bitset' into 'master'
...
Improve selection handling API for rubberbanding
See merge request GNOME/gtk!2086
2020-06-26 12:43:49 +00:00
Matthias Clasen
f07d304f19
main: Avoid a warning
...
transient-for relationships only exist between
windows, so check that both candidates are such.
Fixes : #2894
2020-06-26 08:19:32 -04:00
Emmanuele Bassi
1d1f618a13
Merge branch 'tintou/dropdown-annotations' into 'master'
...
dropdown: Annotate the get_selected_item method
See merge request GNOME/gtk!2152
2020-06-26 08:48:51 +00:00
Emmanuele Bassi
e20610cdc6
Merge branch 'wip/ricotz/annotations' into 'master'
...
gtk: Add some g-i annotations to GtkStringList
See merge request GNOME/gtk!2150
2020-06-26 08:46:35 +00:00
Corentin Noël
721396b6d6
dropdown: Annotate the get_selected_item method
...
We need to specify the type as we already know that it is at least a GObject and in case of no selection, NULL is returned.
2020-06-26 10:00:59 +02:00
Benjamin Otte
dc1dbe6158
listbase: Make rubberbanding a threshold drag
2020-06-26 07:13:32 +02:00
Benjamin Otte
30488e60e2
listbase: Only compute the modifiers when releasing the rubberband
...
... and do the right things:
nothing: selection = rubberband
ctrl: selection = selection OR rubberband
shift: selection = selection AND (NOT rubberband)
ctrl+shift: selection = selection XOR rubberband
(not sure this one makes sense, but toggling is fun)
2020-06-26 07:13:32 +02:00
Benjamin Otte
a5949960bc
listbase: Compute rubberband region on-demand
...
Instead of storing the active items as we go, compute the affected items
whenever the rubberband changes and in particular when the rubberband
ends.
That way, the rubberband is guaranteed to select a rectangle even
after scrolling very far.
This is achieved by having a get_items_in_rect() vfunc that selects all
the items in the rubberbanded rectangle and returns them as a bitset.
2020-06-26 07:13:32 +02:00
Benjamin Otte
ec4a489093
listview: Allocate rubberband at end of size_allocate()
...
Otherwise the rubberband uses the wrong scroll offsets.
2020-06-26 07:13:32 +02:00
Benjamin Otte
7c52e03815
listbase: Flip autoscroll deltas if adjustments are flipped
...
Fixes autoscroll on RTL languages.
2020-06-26 07:13:32 +02:00
Benjamin Otte
724c9361f3
listbase: Allocate gridview items properly on RTL
...
We need to flip the items.
2020-06-26 07:13:32 +02:00
Benjamin Otte
147388e69a
multiselection: Implement get_selection_in_range()
2020-06-26 07:13:32 +02:00
Benjamin Otte
64aa281c97
listbase: Allocate rubberband according to list coords
...
The rubberband is now handled on the list coordinate system.
When starting the rubberband, we track the item under the pointer and
follow it when it is moving.
This may lead to the rubberband start position changing position and
while this may be confusing, it alerts users to the fact that something
crazy is going on.
2020-06-26 07:13:32 +02:00
Benjamin Otte
c2b0330c56
listbase: Move a common function from the children into GtkListBase
...
We want to use it for the rubberband later.
2020-06-26 07:13:32 +02:00
Benjamin Otte
de4803bb21
listbase: Don't do extra work
...
Scrolling causes a queue_resize() which will update the rubberband in
size_allocate() and queue a draw.
2020-06-26 07:13:32 +02:00
Benjamin Otte
e574dcb091
Fix indentation
2020-06-26 07:13:32 +02:00
Benjamin Otte
488b0cbb69
gtk: Remove GtkPropertySelection
...
GtkMultiSelection is so much faster than this that it isn't needed.
2020-06-26 07:13:32 +02:00
Benjamin Otte
6ceab55148
gtk-demo: Port listview-colors demo to multiselection again
2020-06-26 07:13:32 +02:00
Benjamin Otte
3d8b6f6b79
multiselection: Track items across resorts
...
In particular, track which items remain in ::items-changed
signal emissions.
But the main use case is sorting, which causes items-changed(0, n, n)
to be emitted.
2020-06-26 07:13:32 +02:00
Benjamin Otte
58d3213eef
Remove GtkSet
...
It's been superceded by GtkBitset.
2020-06-26 07:13:32 +02:00
Benjamin Otte
006dfdc55a
selectionmodel: Remove select_callback() functions
...
gtk_selection_model_set_selection() takes care of those now.
2020-06-26 07:13:32 +02:00
Benjamin Otte
a38c423ddb
listbase: Port rubberband to gtk_selection_model_set_selection()
2020-06-26 07:13:32 +02:00
Benjamin Otte
fa0295629b
selectionmodel: Add gtk_selection_model_set_selection()
...
Also port the testsuite.
2020-06-26 07:13:32 +02:00
Benjamin Otte
8395698090
selectionmodel: Replace query_range() with get_selection()
2020-06-26 07:13:32 +02:00
Benjamin Otte
277a91dbf8
multiselection: Port to GtkBitset
2020-06-26 07:13:32 +02:00
Benjamin Otte
ff36cfb5be
testsuite: Add tests for GtkBitset
2020-06-26 07:13:32 +02:00
Benjamin Otte
db452f0c45
Add GtkBitset
2020-06-26 07:13:32 +02:00
Rico Tzschichholz
5b1195f874
gtk: Add some g-i annotations to GtkStringList
2020-06-26 06:36:23 +02:00
Benjamin Otte
d830724d4f
Add amalgamated roaring bitmaps source code
...
Taken from https://github.com/RoaringBitmap/CRoaring and fixed to
not spew warnings.
2020-06-26 06:19:56 +02:00
Matthias Clasen
0ef0edfa9a
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!2149
2020-06-25 22:28:07 +00:00
Matthias Clasen
0ec868bd69
inspector: Adapt to dropdown api change
...
The suppported syntax for dropdowns in ui files
has changed. Get with the program.
2020-06-25 16:42:30 -04:00
Matthias Clasen
30e79e8412
docs: Fix a typo
2020-06-25 14:29:24 -04:00
Matthias Clasen
c9b032acab
gtk-demo: Fix a typo in the listbox demo
2020-06-25 14:28:29 -04:00
Matthias Clasen
1f410faccb
searchentry: Update the docs slightly
...
Update the docs to get closer to describing reality.
2020-06-25 14:27:44 -04:00
Matthias Clasen
d0e56106fe
Drop unused includes
...
Don't include gtkfilechooserentry.h where it
isn't used.
2020-06-25 14:27:31 -04:00
Matthias Clasen
3d3d7dbc59
stringfilter: Fix a typo
2020-06-25 14:27:23 -04:00
Emin Tufan Çetin
c0cbf9db5f
Update Turkish translation
2020-06-25 01:05:12 +00:00
Matthias Clasen
db82eaec0a
Merge branch 'wip/carlosg/input-cleanups' into 'master'
...
Some input cleanups
Closes #2851
See merge request GNOME/gtk!2147
2020-06-24 21:32:30 +00:00
Matthias Clasen
f4e200708d
Merge branch 'scrolled-window-api' into 'master'
...
scrolledwindow: Don't take adjustments in new()
See merge request GNOME/gtk!2146
2020-06-24 19:58:03 +00:00
Matthias Clasen
ba1944ded2
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!2145
2020-06-24 19:50:37 +00:00
Carlos Garnacho
8eeef54b2e
gtktextview: Remove child textview items last
...
The function tries to go through every child, so it's convenient
to remove all internal ones first.
2020-06-24 20:35:23 +02:00
Carlos Garnacho
8e549d73a0
gtkwidget: Drop _gtk_widget_[gs]et_shadowed()
...
This API is meaningless now, with grab-notify being handled internally.
2020-06-24 20:35:23 +02:00