Commit Graph

67394 Commits

Author SHA1 Message Date
Emmanuele Bassi
b9ad3172a4 a11y: Document GtkRevealer's accessible state
Use the GROUP role, and make sure to note that the child is always
revealed. Unlike GtkExpander, GtkRevealer can only be programmatically
toggled, so we cannot turn it into a "button" object.
2020-11-12 21:46:06 +00:00
Emmanuele Bassi
0d7fcdda28 a11y: Add more accessible data to GtkTreeExpander
Document the role of the GtkTreeExpander, and the behaviour of the
expander button.

Additionally, improve the label of the expander button, by adding a
fixed "Expand" label, and setting the "labelled-by" relation to the
child of the GtkTreeExpander.
2020-11-12 21:46:06 +00:00
Emmanuele Bassi
75f9b83b1e Establish a control relation between demo search and list
The search entry changes the content of the list view, so we should
mention that relation to assistive technologies.
2020-11-12 21:46:06 +00:00
Emmanuele Bassi
61e980bfb6 a11y: Add accessible actions to GtkSearchEntry
Just like GtkPasswordEntry, GtkSearchEntry should have its set of
accessible actions.
2020-11-12 21:46:06 +00:00
Emmanuele Bassi
ebda736a09 a11y: Mark SearchEntry icons as presentational
While the "clear the search entry" icon behaves like a button, we don't
have any actual action that can trigger it, so let's ignore it.
2020-11-12 21:46:06 +00:00
Emmanuele Bassi
d4ddfdc265 a11y: Set the role on GtkSearchBar
The search bar widget has a "SEARCH" landmark role, which is described
as:

    A landmark region that contains a collection of items and
    objects that, as a whole, combine to create a search facility.
2020-11-12 21:46:06 +00:00
Emmanuele Bassi
f8bb206034 a11y: Icons in buttons are presentational
Buttons are described by text, and the icon child can be safely ignored.
2020-11-12 21:46:06 +00:00
Emmanuele Bassi
87f92a93d3 a11y: Add more accessibility labels to GtkNotebook
Label the various components:

 - the tab list
 - the tab widget
 - the arrow widgets
2020-11-12 21:46:06 +00:00
Emmanuele Bassi
e49e084f4c a11y: Use the stack page title as its accessible label 2020-11-12 21:46:06 +00:00
Emmanuele Bassi
995daa1e29 a11y: GtkStack is a group of stack pages 2020-11-12 21:46:06 +00:00
Emmanuele Bassi
d34936c1ea Handle empty stack pages when creating an ATContext
If we don't have a widget inside GtkStackPage, we should use the default
GdkDisplay.
2020-11-12 21:46:06 +00:00
Emmanuele Bassi
a59889a274 Unrealize the ATContext in StackPage on dispose
Otherwise we're going to try to unrealize it during the GtkStack
destruction, which will emit warnings.
2020-11-12 21:46:05 +00:00
Emmanuele Bassi
bfb054a023 a11y: Icons in WindowControls are presentational only
They don't contribute anything to the accessible description.
2020-11-12 21:46:05 +00:00
Emmanuele Bassi
e940704018 a11y: Ignore more structural roles when computing labels
These roles should not have a fallback name when explicitly unlabelled.
2020-11-12 21:46:05 +00:00
Emmanuele Bassi
429c7fc039 a11y: Add role exception for GtkScrolledWindow
ARIA does not have a "scroll pane" role, but AT-SPI does.
2020-11-12 21:46:05 +00:00
Emmanuele Bassi
0d6e4f7a6e demo: Add more accessibility labels to the UI 2020-11-12 21:46:05 +00:00
Matthias Clasen
1f9eb5c64c Merge branch 'clear-search-entry' into 'master'
searchbar: Fix clearing search entry on hide

See merge request GNOME/gtk!2820
2020-11-12 19:25:57 +00:00
Florian Müllner
056a073061 searchbar: Fix clearing search entry on hide
Commit fa3d1940bf added separate grab handling for GtkSearchEntry, but
didn't consider whether the bar was revealed or concealed. The expected
behavior for the latter is that the entry is cleared rather than focused,
fix the condition accordingly.
2020-11-12 19:59:55 +01:00
Alexander Mikhaylenko
e46522e4b5 theme: Round all window corners 2020-11-12 22:19:00 +05:00
Alexander Mikhaylenko
7ac7919697 theme: Restructure window style 2020-11-12 22:17:52 +05:00
Matthias Clasen
5d9799d4e3 Merge branch 'ebassi/for-master' into 'master'
ATContext lifetime fixes

Closes #3341

See merge request GNOME/gtk!2811
2020-11-12 12:35:23 +00:00
Jakub Steiner
f95943a752 Merge branch 'wip/jimmac/sassc-global-vars' into 'master'
Adwaita: avoid !global

See merge request GNOME/gtk!2816
2020-11-12 12:34:10 +00:00
Jakub Steiner
ef88e9ffcc Adwaita: avoid !global
- Work around having !global variables as sassc will
  no longer support it
2020-11-12 13:14:37 +01:00
Alexander Mikhaylenko
49613dca8e button: Don't make the gesture exclusive
With the last commit, pressing the same button with multiple fingers
doesn't cause extra emissions, so we can remove exclusive and allow
pressing multiple buttons at once on touch.
2020-11-12 15:27:16 +05:00
Alexander Mikhaylenko
a651a0ce69 gestureclick: Only emit release for the same sequence
Avoid spurious releases when touching the same widget with another finger.
2020-11-12 15:26:36 +05:00
Emmanuele Bassi
08d59d3f68 docs: Add "Accessibility" section to various widgets
There are a few widgets that gained an accessible role, which means
adding an "Accessibility" section in their description.
2020-11-12 00:36:32 +00:00
Matthias Clasen
afff39c503 Merge branch 'suggestion-entry-demo2' into 'master'
gtk-demo: Add suggestion entry demos

See merge request GNOME/gtk!2812
2020-11-11 21:40:07 +00:00
Matthias Clasen
a2897e1868 gtk-demo: Add suggestion entry demos
Add a possible replacement for GtkEntryCompletion
as a demo.

Move the Dropdowns demo to Lists/Selections, and make
it show both GtkDropDown and the suggestion entry, with
some variations.
2020-11-11 15:54:43 -05:00
Matthias Clasen
15172ebdb0 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2810
2020-11-11 20:49:51 +00:00
Emmanuele Bassi
9ac4a7d99f a11y: Simplify GtkModelButton
Instead of recreating GtkATContexts in order to change their role, we
can simply unrealize and realize them back.
2020-11-11 19:45:43 +00:00
Emmanuele Bassi
8157717e03 a11y: Add missing fallback for accessible-role getter
If the per-instance accessible role is unset, use the class role.
2020-11-11 19:45:43 +00:00
Emmanuele Bassi
9052f6dafe a11y: Rework ownership and lifetime of GtkATContext
Now that GtkATContext is explicitly realized and unrealized, we should
always create an instance at widget initialization time, and drop it
during the widget finalization. This should make it easier to set up the
initial accessible state of a widget during the instance initialization,
as well as reduce the chances of accidental creation of GtkATContext
instances during the destruction sequence.
2020-11-11 19:45:43 +00:00
Emmanuele Bassi
292576f312 a11y: Defer to the GtkAccessible's implementation
Since GtkATContexts are now lazily realized, we need to go through the
GtkAccessible's implementation to access the :accessible-role property,
in case there are fallbacks.
2020-11-11 19:45:43 +00:00
Emmanuele Bassi
2285382074 a11y: Create AtSpiRoot on realization
There's no need to do a lot of work on construction, if we're delaying
all remote work after the GtkATContext is realized.

The GtkAtSpiContext should also keep a reference on the root, and drop
it at unrealize time.
2020-11-11 18:46:44 +00:00
Emmanuele Bassi
526f1e315b a11y: Use GROUP role for GtkNotebook
A notebook is a grouping of a tab list, tabs, and tab pages.
2020-11-11 18:46:11 +00:00
Emmanuele Bassi
877a7f98ca a11y: Protect should_present() from empty contexts
If the GtkAccessible implementation returns a NULL context, we should
not be calling methods on it.
2020-11-11 18:33:15 +00:00
Emmanuele Bassi
73b14a3c3a a11y: Do not leak the ATContext in GtkStackPage
GtkStackPage is not a widget, so it must release the reference on the
ATContext it owns.
2020-11-11 18:33:15 +00:00
Emmanuele Bassi
40c0826921 a11y: Mark more containers as structural elements
Widgets that just provide grouping and layout to other widgets should
not be relevant to the accessible tree.
2020-11-11 18:33:15 +00:00
Emmanuele Bassi
27b9b2e76c a11y: Use the window title as its label 2020-11-11 18:33:15 +00:00
Emmanuele Bassi
04c4d293a7 a11y: Skip unlabelled structural roles
If a structural role is left unlabelled, just leave it unnamed.
2020-11-11 18:33:15 +00:00
Emmanuele Bassi
033791b374 a11y: Translate ARIA windows to AT-SPI frames
For backward compatibility with GTK3.
2020-11-11 18:33:15 +00:00
Emmanuele Bassi
95ee5ff424 a11y: Add more ARIA/AT-SPI role translations 2020-11-11 18:33:15 +00:00
Emmanuele Bassi
65d29e00c7 a11y: Realize parent ATContext for the stack page
Just like for popovers, the stack page is not directly connected on the
widget's DOM, so we need to realize the parent ATContext ourselves.
2020-11-11 18:33:15 +00:00
Emmanuele Bassi
3b2cd972d5 a11y: Implement missing atspi.Component getters
Some of them are entirely innocuous, and we can easily provide values
that match what GTK3 provides.
2020-11-11 18:33:15 +00:00
Emmanuele Bassi
428ec29598 a11y: Unrealize ATContext on dispose()
By unrealizing the context we avoid additional work during the dispose
phase, in case widget code updates the accessible state. We use
GtkAccessible's API, to ensure we unrealize the right ATContext, instead
of the one we store inside GtkWidgetPrivate.

We drop the ATContext instance inside GtkWidget during finalization, to
mop up eventual vivifications there.
2020-11-11 18:33:15 +00:00
Matthias Clasen
bfe5b0d1b7 Adwaita: Don't do n-th child things for list rows
Making the list row child css depend on the position
is very expensive, and does not acutally work correctly
(since we don't have widgets for all children, so the
position of the child widget does not reflect the actual
model item position).

To make this more palatable, use the bottom border
instead of the top border, since most lists have a natural
border at the top (with headers), and may end up with
empty space at the bottom.
2020-11-11 13:18:08 -05:00
Matthias Clasen
82b855cc4b label: Avoid a needless strdup
Don't duplicate the string before we know if it
has actually changed.
2020-11-11 12:24:35 -05:00
Matthias Clasen
0db504edde label: Optimize GtkLabel setters
The overarching goal here is to not queue a resize
unless something has actually changed. In columnview
scenarios, we often deal with hundreds of labels.

Labels are cattle, not pets.
2020-11-11 11:48:27 -05:00
Matthias Clasen
5ed3ad6cc8 gtk-demo: Split off SvgPaintable
Put the SvgPaintable implementation into its
own source files, for ease of copying.
2020-11-11 10:35:54 -05:00
Matthias Clasen
27c4c19333 Don't hide widgets in dispose()
This is leftover code from when widgets were hidden
by default, and was setting them back to their initial
state.

This is getting in the way now, as hiding the widget
updates the HIDDEN accessible state, which ends up
re-creating the at context that we've already disposed
of, leading to memory leaks.
2020-11-11 10:35:54 -05:00