Commit Graph

23 Commits

Author SHA1 Message Date
Florian Müllner
64962508e9 quickSettings: Fix MenuToggle clicks
With the split menu toggle, the actual clicks now happen on the
internal quick toggle, not the menu toggle as a whole where callers
expect it.

Forward the signal to fix that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2636>
2023-02-11 13:38:42 +01:00
Florian Müllner
7ee3514ddb quickSettings: Allow interactive slider icons
Before the move to quick settings, it was possible to mute the volume
by clicking to the left of the slider. In order to re-enable that
feature, allow slider icons to be interactive.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5974

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2630>
2023-02-10 16:27:28 +00:00
Florian Müllner
cf89a6d01e quickSettings: Split menu toggle
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>
2023-02-09 21:53:07 +00:00
Georges Basile Stavracas Neto
1619b8f95d quickSettings: Add 'subtitle' property
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>
2023-02-04 14:50:36 -03:00
Georges Basile Stavracas Neto
2d2172da32 quickSettings: Rename 'label' property to 'title'
We'll soon add a subtitle, so rename the label property to something
that is a bit more semantic.Add a warning when trying to set the old
'label' property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
2023-02-04 14:50:36 -03:00
Jonas Ådahl
8d68bdaaa1 js: Queue 'later' via MetaLaters
This replaces the meta_later_add() API which used now removed global
singletons under the hood.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2557>
2022-12-16 22:12:59 +01:00
Sebastian Keller
3b216be637 quickSettings: Ensure toggle buttons are aligned with the pixel grid
If the width of the menu was not a multiple of the number of columns,
the toggle buttons after the first column would not be aligned with the
pixel grid. This was causing text rendering issues and slightly blurry
icons.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6210
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2577>
2022-12-12 17:14:08 +00:00
Sebastian Keller
54f112fa59 quickSettings: Use column spacing not row spacing to calculate width
This did not have any not have any noticeable effect, because both are
the same size in the default theme.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2577>
2022-12-12 17:14:08 +00:00
Carlos Garnacho
bcafa512e3 quickSettings: Make parent StWidget have a 0x0 size
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>
2022-11-16 16:51:49 +00:00
Sam Hewitt
ea7b29e049 css/quick-settings: Update icon-button styles
- add an entire	flat style to button drawing function
- clean	up the icon button css in quick	settings
- adjust padding in QS sliders
- fixes #5918

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2510>
2022-10-18 19:43:10 +00:00
Jonas Ådahl
c080bc59a4 quickSettings: Update bind constraint offset on idle
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>
2022-09-17 18:09:57 +00:00
Florian Müllner
646cb41e83 quickSettings: Override StButton:label property
StButton already has a :label property, so we should override it
instead of shadowing it with a new property of the same name, like
we already do for :icon-name.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2462>
2022-08-31 16:40:30 +00:00
Florian Müllner
b7d738dfff quickSettings: Fix slider accessibility
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>
2022-08-18 23:00:12 +00:00
Florian Müllner
0fdca0d21a quickSettings: Bind menu arrow's reactivity to parent
When a QuickMenuToggle is made insensitive, then it is unexpected
that its menu can still be opened despite the appearance.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2405>
2022-08-06 21:27:15 +00:00
Florian Müllner
c2e8f41bdf quickSettings: Add QuickSlider
Between input/output volume and brightness, we have enough use
cases for a common slider QuickSettingsItem, in particular as
the items can have a menu.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
2022-08-03 12:41:05 +00:00
Florian Müllner
4b9dcb3f89 quickSettings: Add QuickMenuToggle
This is a convenience subclass for a quick toggle with a menu.

The menu can be disabled dynamically and if enabled, an arrow
is displayed that allows opening the menu.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
2022-08-03 12:41:05 +00:00
Florian Müllner
3ce3034fdd quickSettings: Color header icon if checked
... as requested by the design team.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
2022-08-03 12:41:05 +00:00
Florian Müllner
a0436d4b48 quickSettings: Add header to QuickToggleMenu
All menus in the mockups spot a header, and as we are using a
custom menu type anyway, just add some API there.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
2022-08-03 12:41:05 +00:00
Florian Müllner
e0c61f53f1 quickSettings: Add menu support to items
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>
2022-08-03 12:41:05 +00:00
Florian Müllner
24e842c52e quickSettings: Support child menus in QuickSettingsMenu
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>
2022-08-03 12:41:05 +00:00
Florian Müllner
f18d103f83 quickSettings: Add SystemIndicator
This serves the exact same purpose as the existing SystemIndicator
class from PanelMenu, except that it exposes a quickSettingsItems
array instead of a menu.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
e5d4984c1b quickSettings: Add QuickToggle
Most quick settings items are just buttons with icon, label, and
a particular style. While that's easy enough, a dedicated class
with corresponding properties is more convenient.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2392>
2022-08-02 16:05:28 +00:00
Florian Müllner
47cb354e6c quickSettings: Introduce QuickSettingsMenu
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>
2022-08-02 16:05:28 +00:00