We will need some more access to the menu's underlying grid to
provide extension API for adding additional quick items.
Expose a new getFirstItem() method that (surprise!) returns the
first item.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2894>
The QuickSettings menu currently only support appending items
at the end. Extensions can get around that limitation by accessing
the private grid property to move the item afterwards, but we don't
allow this in our own code.
Expose a new insertItemBefore() method that allows adding an item
before an existing one.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2894>
Both :icon-name and :gicon are propagated to the internal QuickToggle
with property bindings. However the bindings are set up in the wrong
order:
:icon-name is a convenience property to set :gicon to a ThemedIcon
of the given name. That means binding :icon-name first will correctly
set the underlying StIcon's :gicon, but then the :gicon binding will
set it again to null.
Fix this by swapping the order in which the bindings are set up,
so that it works for both properties.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6542
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2726>
When the `QuickMenuToggle` was a discrete button, it could be set to
toggle mode, but the inner buttons no longer reacts as expected.
Bind the `toggle-mode` property between the `QuickMenuToggle` and its
contents so they behave as single toggle when enabled.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2664>
Menu toggles are currently regular toggles with an additional
arrow button. This allows for a simpler implementation, but
has downsides with regards to keyboard navigation and hover
feedback.
To make it more obvious that the two parts of the menu toggle
perform different actions, change the overall structure of the
toggle to *contain* a regular toggle and the menu button.
That way each element uses its own hover effect, and shows up
in the keynav focus chain.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5964
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2632>
Add a subtitle label to QuickToggle, with a less prominent font.
Make the subtitle invisible when no text is present.
This new property will be used by next commits to implement quick
settings with a static title, and a changing subtitle.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
The quick settings menu is child of an actor at 0,0 coordinates,
simply transformed to look in place. However the parent actor stays
at 0,0, and gets a width/height that is able to contain the child
menu (even though the transform will push it outside the parent
actor).
This makes the parent actor (not meant to handle pointer/touch
input) to cover parts of the shell. Since this actor is also where
the Clutter grab happens, the menu is not dismissed either.
Make this parent actor have a 0x0 size, so that it can still act
as the parent for the quick settings menu, but does not actually
cover any area. This makes clicks around the top left corner work
again while the quick settings menu is opened.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5887
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2535>
Use Meta.LaterType.BEFORE_REDRAW to queue setting the bind constraint
offset in an idle callback. This is needed since the signals that
trigger updating the offset may be emitted during allocation, at which
point queuing new relayouts isn't ideal, since it could result in
relayout cycles. In this case, we really do want to relayout as a side
effect of another actors allocation, so make this explicit.
This fixes a few warnings such as:
The actor '<unnamed>[<StBoxLayout>:0x3138d70]' is currently inside an
allocation cycle; calling clutter_actor_queue_relayout() is not recommended
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2476>
Since we put the actual slider into a bin to get a proper focus
indication, the slider isn't focused anymore and its accessible object
is therefore invisible to the screen reader.
Fix this by passing the slider's accessible object to the actor
that takes the focus.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2431>
Now that the QuickSettingsMenu supports child menus, it is time
to add menu support to quick toggles.
Do that by introducing a QuickSettingsItem parent class with a
construct-only :has-menu property, as that will allow including
menus in items that aren't following the standard icon+label
pattern of QuickToggle (yes, we'll have some of those).
A common parent class also allows us to control the type of
menu that is created. That's important, as we need another
custom menu type to
- constrain the menu's y position to place it underneath
the source actor
- use open/close animations taylored for this use case
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
This is where it gets hairy.
Some quick settings items will have an associated menu. When
opened, the main menu should grow to make room for the child
menu, as it would do if it contained the child.
At the same time, the child menu will attach to its parent, and
block all input there while it is open.
Menu-modal menus so to speak.
Implement this as follows:
- change the QuickSettingsMenu actor to a stack that holds
- the boxpointer (a.k.a. the actual menu)
- an overlay actor to hold child menus
- use constraints to bind the overlay's position and width
to the boxpointer; the y position is offset to align the
overlay with the grid inside the actual menu
- add a placeholder actor to the main grid, whose height is
bound to the overlay height; using a "clone" instead of
the actual overlay means that layout changes are not triggered
from outside the grid hierarchy, which would be prone to
allocation warnings
- update the layout manager to not allocate the placeholder as
a regular grid child, but instead include its height in the
space underneath the row with an open menu
- apply a dim effect to the boxpointer when a child menu is
open, to indicate that input is blocked
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
The quick settings menu is a popover that arranges items in a
reflowing, homogeneous grid. Grid children may span multiple
columns, but not rows.
For now the QuickSettingsMenu that contains the grid is just a
convenience wrapper around the layout manager that does the heavy
lifting. The two will become more intertwined when we add support
for menu toggles though, so the custom menu type is unfortunately
needed.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>