Commit Graph

35749 Commits

Author SHA1 Message Date
Matthias Clasen
b251893030 Drop pango version checks
We are requiring pango 1.45.0 now, so no need to
Keep these ifdefs in the code any longer.
2020-06-06 21:32:55 -04:00
Matthias Clasen
1567db1f02 Merge branch 'misc-multiselection' into 'master'
Misc multiselection

See merge request GNOME/gtk!2055
2020-06-06 17:54:42 +00:00
Matthias Clasen
8316d5e366 Merge branch 'list-arrows' into 'master'
listbase: Make up/down arrows work

See merge request GNOME/gtk!2056
2020-06-06 17:47:05 +00:00
Matthias Clasen
8fca040163 Merge branch 'property-selection' into 'master'
Property selection

Closes #2826

See merge request GNOME/gtk!2054
2020-06-06 17:35:05 +00:00
Matthias Clasen
c0fe1a7ffe listbase: Make up/down arrows work
We were missing a binding for up/down without modifiers.
2020-06-06 12:33:12 -04:00
Matthias Clasen
e72c243aca singleselection: Clarify docs
Mention persistence and sorting.
2020-06-06 11:53:33 -04:00
Matthias Clasen
d1509971d8 Add GtkPropertySelection
This is a selection model that stores the selection
state in a boolean property of the items, and thus
persists across reordering and similar changes.

Fixes: #2826
2020-06-06 11:41:51 -04:00
Matthias Clasen
3e6e247e56 multiselection: Rewrite the select_callback implementation
Use a for loop to make this more obvious, and add some
assertions that the callback is behaving properly.
2020-06-06 11:22:48 -04:00
Matthias Clasen
b0cf7a95b0 Add a forgotten export
gtk_selection_model_unselect_callback needs to be exported.
2020-06-06 11:22:48 -04:00
Matthias Clasen
fd7f19c934 selectionmodel: Document the callback apis 2020-06-06 10:36:57 -04:00
Matthias Clasen
de6327a885 multiselection: Clarify docs
Make it clear that GtkMultiSelection is not persistent
across resorting.
2020-06-06 10:24:14 -04:00
Matthias Clasen
c3a6e35070 Drop an unnecessary include 2020-06-06 09:39:36 -04:00
Matthias Clasen
71c29bfcff listitemmanager: Handle selection-changes properly
The selection model will only emit one of items-changed
or selection-changed, so when we handle an items-changed,
we must assume that selection state may have changed for
any of the newly added items.

This fixes lingering selection state in the visible range
if you change the sorting of the colors demo.

Fixes: #2827
2020-06-06 08:36:11 -04:00
Matthias Clasen
a0c489048a Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2052
2020-06-06 05:30:30 +00:00
Matthias Clasen
9fa65eadae listitemwidget: Don't look at rubberbanding
Move the selection changes to button release, to
avoid conflict with the drag gesture for rubberbanding.
This avoids peeking at the parent, and is generally
nicer.

Among other things, you can now shift-click to select
a range in the colors demo in gtk4-demo.
2020-06-06 00:23:04 -04:00
Matthias Clasen
facfff0022 listbase: Fix an off-by-one error
We were accidentally cutting off the set one-too-early,
which showed up as single clicks not selecting an item
anymore.
2020-06-06 00:15:50 -04:00
Matthias Clasen
f8b4083f47 listbase: Fix a problem with rubberbands
When I changed things to only collect the set
in the stop() function, I overlooked that this
has the side-effect of only handling items which
are backed by a widget at the time stop() is called.
If we make a big rubberband and autoscroll down too
far, we loose the items that go out the visible range
at the top. Fix that by maintaining the set as we go.
2020-06-05 23:18:00 -04:00
Matthias Clasen
b047b7838d multiselection: Don't emit nonsensical signals
I forgot to add a check here. We only want to emit
a ::selection-changed if we actually changed it.
2020-06-05 23:15:20 -04:00
Benjamin Otte
b1c00ecee6 multiselection: Remove unused code
This is leftover code from an earlier SelectionModel API.
2020-06-06 05:02:37 +02:00
Matthias Clasen
3412f0554f gtk: Documentation fixups
Document missing symbols, and other cleanups.
2020-06-05 22:50:30 -04:00
Matthias Clasen
b0e81acc12 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2050
2020-06-05 23:55:12 +00:00
Matthias Clasen
be6bcf882d spinbuttonaccessible: Fix an oversight
We need to pass the accessible to the signal handler.
2020-06-05 17:21:26 -04:00
Matthias Clasen
fb344e8108 Trivial typo fix 2020-06-05 17:08:43 -04:00
Emmanuele Bassi
b99389bcb8 a11y: Drop GtkWidgetAccessibleClass.notify_gtk
It's finally unused.

Accessible types should either watch properties they are interested in
directly, or should have (private) API to allow widgets to update the
accessible state directly.
2020-06-05 20:35:11 +01:00
Emmanuele Bassi
0fefdc99b2 a11y: Simplify GtkEntryAccessible
Now that we don't have any additional subclasses of GtkEntryAccessible
in GTK, we can drop all the conditional fluff in the base class.

We still need to subscribe to the global notify signal, because of the
sheer amount of properties watched by GtkEntryAccessible.
2020-06-05 20:35:11 +01:00
Emmanuele Bassi
e63419fbf4 a11y: Implement GtkPasswordEntryAccessible properly
GtkPasswordEntryAccessible is not a GtkEntryAccessible any more, so it
will need a proper implementation of various interfaces and
functionality in order to work like any other entry.
2020-06-05 20:35:11 +01:00
Emmanuele Bassi
428bb09a35 a11y: Make GtkSearchEntryAccessible a full GtkWidgetAccessible
We should not inherit from GtkEntryAccessible, given that GtkSearchEntry
is *not* a GtkEntry.
2020-06-05 20:35:11 +01:00
Emmanuele Bassi
7c2c795681 a11y: Simplify GtkScrollbarAccessible 2020-06-05 20:35:11 +01:00
Emmanuele Bassi
165f352c58 a11y: Simplify GtkScaleButtonAccessible 2020-06-05 20:35:11 +01:00
Emmanuele Bassi
3d6e702f63 a11y: Simplify GtkSpinButtonAccessible
We're already listening to the adjustment property on the spin button,
there's no need to reset the adjustment on widget set/unset, since the
accessible instance is always tied to the same widget.
2020-06-05 20:35:11 +01:00
Emmanuele Bassi
597e9a96b4 a11y: Simplify GtkTextAccessible 2020-06-05 20:35:11 +01:00
Emmanuele Bassi
6f4ed6c105 a11y: Simplify GtkTextViewAccessible
Drop the GtkWidgetAccessible.notify_gtk override.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
c3eafed472 a11y: Simplify GtkColorSwatchAccessible
Drop the GtkWidgetAccessible.notify_gtk override.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
7480fb703e a11y: Simplify GtkNotebookAccessible
Let the GtkNotebook explicitly update the accessible object that the
current page has changed, instead of overriding
GtkWidgetAccessible.notify_gtk.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
24e8b484e0 a11y: Simplify GtkWindowAccessible
Have GtkWindow notify of title changes, instead of overriding
GtkWidgetAccessible.notify_gtk.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
d60f7f2e7a a11y: Simplify GtkExpanderAccessible
Drop the GtkWidgetAccessible.notify_gtk and AtkObject.initialize
overrides, and have GtkExpander update the state of the accessible
object directly.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
0dcffe7c33 a11y: Simplify GtkLevelBarAccessible
Drop the GtkWidgetAccessible.notify_gtk and AtkObject.initialize
overrides, and have GtkLevelBar notify the accessible object of value
changes.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
9f09cfcfbd a11y: Split GtkSearchEntryAccessible from GtkEntryAccessible
Use a separate accessible object for the GtkSearchEntry, just like we
did for GtkPasswordEntry.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
7373cd962c a11y: Split password entry accessible from GtkEntryAccessible
Use a separate accessible object.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
ac3f0df083 a11y: Simplify GtkProgressBarAccessible
Drop the GtkWidgetAccessibleClass.notify_gtk and the
AtkObjectClass.initialize overrides: they don't do anything relevant.

Instead, have GtkProgressBar update the accessible state when the
fraction changes.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
f95d54a13d a11y: Use G_DECLARE macro for GtkWidgetAccessible
Allows us to drop the Private structure typedef.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
fc512f0b9f a11y: Update the accessible state when GtkIconView:model changes
Do not use a generic "notify" signal handler.

Additionally, clean up the GtkIconViewAccessible implementation to bring
it up with modern idiomatic GObject.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
f5ed59b7f2 a11y: Drop notify_gtk() from GtkRangeAccessible
Let the GtkRange notify the accessible instance when the adjustment
changes.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
9d51aa1443 a11y: Drop notify_gtk() from GtkButtonAccessible
Make GtkButton notify the accessible state directly when updating the
label.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
f0bdc865b9 a11y: Remove GtkToggleButtonAccessible notify_gtk implementation
The base GtkWidgetAccessible class does the right thing by default.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
eda1703f9d a11y: Update accessible state for GtkTreeView directly
Do not use GtkWidgetAccessibleClass.notify_gtk().
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
51fc382582 Notify accessibility state changes from GtkWidget
Piggybacking on blanket GObject::notify is not very efficient.
2020-06-05 20:35:10 +01:00
Emmanuele Bassi
6e52ef96a4 Move orientable style classes into GtkWidget
It feels slightly wrong to have GtkOrientable operate on widgets, but at
least what happens when an orientable widget changes orientation should
be part of GtkWidget.

This will allow to add more state changes without accessing widget state
from the outside of gtkwidget.c.
2020-06-05 20:35:09 +01:00
Emmanuele Bassi
9606c1eee9 Notify mapped state to the accessible object directly
Do not use signal connections: if we have an accessible object, notify
it directly when getting mapped and unmapped.
2020-06-05 20:32:27 +01:00
Emmanuele Bassi
959c101400 Drop unused AtkRegistry path
We expect widgets to use their own derived GtkWidgetAccessible type,
these days, and given that we hard code the default accessible type of a
GtkWidget to GtkWidgetAccessible, and that we enforce the dependency of
the type passed to gtk_widget_class_set_accessible_type(), the registry
code path is clearly unused.
2020-06-05 20:32:27 +01:00