843 Commits

Author SHA1 Message Date
Florian Müllner
079daac9bb screenshot-window-sizer: Mention shortcut in description
Loosely based on the README entry, so users know how to actually use the
extension.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/541
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/358>
2024-11-25 15:43:54 +01:00
Florian Müllner
99d49c1800 places-menu: Inherit from PopupImageMenuItem
PopupImageMenuItems used to position the icon after the label,
so we ended up with our own icon+label items.

However the icon position was changed years ago in the shell, so
inherit from PopupImageMenuItem instead.

This does not only simplify the code a bit, but also pulls in
features we are currently missing, like a11y labelling.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/542
(cherry picked from commit 568826e489)
2024-11-25 14:19:07 +01:00
Florian Müllner
451a12d1fd cleanup: Use consistent line break style in meson.build
Either have all arguments on the same line, or have a separate
line for every argument (that is, don't special-case the first
arg).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/353>
(cherry picked from commit 265935e14b)
2024-11-25 14:18:35 +01:00
Florian Müllner
f30990535f extensions: Remove modelines
We already include an .editorconfig that is supported by many
editors, including emacs, so no need to repeat an emacs-specific
modeline in every source file.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/353>
(cherry picked from commit 253ddb8642)
2024-11-25 14:17:25 +01:00
Florian Müllner
099b2eeb49 cleanup: Use null for nick/blurb in ParamSpecs
As they are only used by gstreamer for gst-inspect & other tools.
Projects like mutter and gtk have already completely dropped them,
so follow their lead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/347>
(cherry picked from commit 46a4fa0976)
2024-10-18 19:15:02 +02:00
Florian Müllner
67cdd0bea2 window-list: Remove outdated style
A long time ago, the window list used to embed the bottom message
tray, which caused notifications to inherit the window-list's
font style.

Since that's no longer the case, we have no business in messing
with notification styling, so stop doing that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/338>
(cherry picked from commit f1671bc206)
2024-10-17 20:56:38 +02:00
Florian Müllner
87a849c5af window-list: Switch to Adw.SwitchRow
libadwaita fixed the actionable implementation of Adw.SwitchRow,
so can use the convenience widget instead of composing our own.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/341>
(cherry picked from commit 548d7659e1)
2024-10-17 20:56:26 +02:00
Florian Müllner
f0bff952be window-list: Remove superfluous bindings
The setting is already bound to the switch via the corresponding action,
no need to also set up a binding.

In fact, the second binding is actively harmful, as it keeps the
connection alive until dispose, so the setting is reset on
garbage collection.

Closes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/511

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/341>
(cherry picked from commit 0162644041)
2024-10-17 20:56:18 +02:00
Florian Müllner
b3ff771a1d window-list: Add missing action
Commit 24ba03fe9 added a new setting, but forgot to create the
corresponding action.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/341>
(cherry picked from commit 062a3d21ab)
2024-10-17 20:56:09 +02:00
Florian Müllner
3ef718d34c window-list: Fix active state
Commit c72b8b21 fixed the styling of the active window's button,
but missed that the `active` property uses the style information
as well.

Adjust it to use the correct actor when checking for the style class.

Closes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/529

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/342>
(cherry picked from commit a5a92026ac)
2024-10-17 20:55:59 +02:00
Florian Müllner
fb2d87c1da window-list: Fix minimized styling
Commit 039c66e7b7 wrapped the button in a container to
animate transitions, but didn't adjust the `.minimized`
styling to still apply to the button (where it is
expected) rather than the wrapper.

Fix this just like commit c72b8b21 did for the
`.focused` styling.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/342>
(cherry picked from commit 28fd210f28)
2024-10-17 20:55:52 +02:00
Florian Müllner
4da312040b window-list: Don't recreate icons on theme changes
All icons use `StIcon`, which already updates itself correctly
on icon theme changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/337>
(cherry picked from commit d43abe0869)
2024-10-17 20:55:22 +02:00
Florian Müllner
89276cc184 window-list: Small stylesheet cleanup
The light stylesheet duplicates some declarations, and the
last occurrence matches what we already inherit from the
dark stylesheet.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/337>
(cherry picked from commit 860c56f83e)
2024-10-17 20:55:07 +02:00
Florian Müllner
017c6470b9 workspace-indicator: Re-fittsify workspace previews
For the window-list extension, it is important that the workspace
previews extend to the bottom edge for easier click targets.

That broke while merging the code with the workspace-indicator,
fix it again by moving the padding from the parent box into the
thumbnail children.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/327>
2024-07-31 15:01:08 +00:00
Florian Müllner
1e25fc1b5a status-icons: Add new extension
Based on an original "top-icons" extension by Adel Gadllah that
is no longer maintained.

The code has been heavily simplified and modernised, and adapted
to integrate into the top bar more seemlessly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/194>
2024-07-31 14:42:55 +00:00
Jakub Steiner
e28215f38f window-list: Update styling
- Contemporary look. Fewer borders, thinner outlines for workspace indicators
- Lacks the designed unfocused window separators.
- Relies on https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/328

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/421

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/330>
2024-07-31 14:37:31 +00:00
Florian Müllner
c72b8b2122 window-list: Fix .focused styling
Commit 039c66e7b7 wrapped the button in a container to
animate transitions, but didn't adjust the `.focused`
styling to still apply to the button (where it is
expected) rather than the wrapper.

Fix that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/328>
2024-07-13 00:11:19 +02:00
Florian Müllner
0554a8e97d window-list: Replace custom tooltip implementation
DashItemContainer already has support for showing a tooltip-like
label, so now that we use that for animating items, we can use
it for tooltips as well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/325>
2024-06-29 13:43:55 +02:00
Florian Müllner
039c66e7b7 window-list: Animate buttons in and out
Buttons are currently added and removed from the list without
any transitions, which gives the list a "jumpy" feel. Instead,
do what we do elsewhere and smoothly animate additions and
removals by re-using the dash's ItemContainer class.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/325>
2024-06-29 13:43:55 +02:00
Florian Müllner
7eb00e350e window-list: Don't hide window button while unmanaging
This will allow to animate the transition.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/325>
2024-06-29 13:43:55 +02:00
Florian Müllner
f76f9e8220 window-list: Don't use homogeneous layout
We want all buttons in the window list to have the same size,
but that's already achieved via max/natural-width in the CSS.

Not enforcing the equal size via the layout manager will allow
buttons to temporarily have a different size when we start
animating additions and removals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/325>
2024-06-29 13:13:12 +02:00
Florian Müllner
da90d365ec window-list: Use getter methods for events
The underlying structs were made opaque a while ago, so direct
access to the struct fields is no longer possible.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/320>
2024-04-26 15:22:16 +02:00
Florian Müllner
02ff72b2f0 apps-menu: Set label_actor of Category items
Category items are based on BaseMenuItem rather than MenuItem,
so the accessible relationship isn't set up automatically for us.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/319>
2024-04-25 14:42:53 +00:00
Florian Müllner
24ba03fe96 window-list: Expose workspace preview option
Now that we have the option, the window-list should expose it
in its preference window like the workspace-indicator.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/316>
2024-04-24 14:23:22 +00:00
Florian Müllner
69d8d1a335 workspace-indicator: Make previews configurable
Now that previews scroll when there are too many workspaces,
there is no longer a reason for the 6-workspace limit.

However some users do prefer the menu, so rather than drop it,
turn it into a proper preference.

Closes
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/336

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/316>
2024-04-24 14:23:22 +00:00
Florian Müllner
d495a2eed8 workspace-indicator: Also show previews in menu
Since the regular session also switched to horizontal workspaces,
using a vertical menu has been a bit awkward.

Now that our previews have become more flexible, we can use them
in the collapsed state as well as when embedded into the top bar.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/316>
2024-04-24 14:23:22 +00:00
Florian Müllner
6b3990457e workspace-indicator: Stop handling vertical layouts
Both the regular session and GNOME classic use a horizontal layout
nowadays, so it doesn't seem worth to specifically handle vertical
layouts anymore.

The extension will still work when the layout is changed (by some
other extension), there will simply be a mismatch between horizontal
previews and the actual layout.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/316>
2024-04-24 14:23:22 +00:00
Florian Müllner
099cff0b95 workspace-indicator: Support labels in previews
The space in the top bar is too limited to include the workspace
names. However we'll soon replace the textual menu with a preview
popover. We can use bigger previews there, so we can include the
names to not lose functionality with regards to the current menu.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/316>
2024-04-24 14:23:22 +00:00
Florian Müllner
fac7fedfd3 workspace-indicator: Handle preview overflow
We currently avoid previews from overflowing in most setups by
artificially limiting them to a maximum of six workspaces.

Add some proper handling to also cover cases where space is more
limited, and to allow removing the restriction in the future.

For that, wrap the previews in an auto-scrolling scroll view
and add overflow indicators on each side.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/316>
2024-04-24 14:23:22 +00:00
Florian Müllner
6ed1b56526 workspace-indicator: Split out WorkspacePreviews
The previews will become a bit more complex soon, so spit them out
into a dedicated class.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/316>
2024-04-24 14:23:22 +00:00
Florian Müllner
a2ffb1238f workspace-indicator: Handle active indication in thumbnail
Meta.Workspace has had an `active` property for a while now, so
we can use a property binding instead of tracking the active
workspace ourselves.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/316>
2024-04-24 14:23:22 +00:00
Florian Müllner
b55e7a4dc8 workspace-indicator: Simplify scroll handling
gnome-shell already includes a method for switching workspaces
via scroll events. Use that instead of implementing our own.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/316>
2024-04-24 14:23:22 +00:00
Florian Müllner
0c42f162d3 window-list: Use actual copy of workspace-indicator
We are now at a point where the code from the workspace-indicator
extension is usable from the window-list.

However instead of updating the copy, go one step further and
remove it altogether, and copy the required files at build time.

This ensures that future changes are picked up by both extensions
without duplicating any work.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
5e88c7d891 workspace-indicator: Support light style
The window-list extension already includes light styling for
its copy of the workspace indicator. Just copy that over to
support the light variant here as well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
af23a8491c workspace-indicator: Tweak preview style
Sync sizes and padding with the window-list previews.

Tone down the colors a bit, but less then the current window-list
style where workspaces blend too much into the background and
the selection is unclear.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
32a454f917 workspace-indicator: Include n-workspaces in status label
The two extensions currently use a slightly different label
in menu mode:
The workspace indicator uses the plain workspace number ("2"),
while the window list includes the number of workspaces ("2 / 4").

The additional information seem useful, as well as the slightly
bigger click/touch target, so copy the window-list behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
63ff5b2ac1 workspace-indicator: Simplify getting status text
Currently the same method is used to get the label text for the
indicator itself and for the menu items.

A method that behaves significantly different depending on whether
a parameter is passed is confusing, so only deal with the indicator
label and directly use the mutter API to get the workspace names
for menu items.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
a9fff9861b workspace-indicator: Small cleanup
The code to update the menu labels is a bit cleaner in the
window-list extension, so use that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
89a3daf9fe workspace-indicator: Only change top bar redirect when in top bar
While this is always the case for the workspace indicator, adding
the check will allow to use the same code in the window list.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
078a5a01ae workspace-indicator: Support showing tooltips above
The indicator is located in the top bar, so tooltips are always
shown below the previews. However supporting showing tooltips
above previews when space permits allows the same code to be
used in the copy that is included with the window-list extension.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
9c8c3495b6 workspace-indicator: Don't use menu section
We never added anything else to the menu, so we can just operate
on the entire menu instead of an intermediate section.

This removes another difference with the window-list copy.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
25e854dde8 workspace-indicator: Use existing property
We already track the current workspace index, use that
instead of getting it from the workspace manager again.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
64060ef4c5 workspace-indicator: Don't use SCHEMA/KEY constants
Each constant is only used once, so all they do is disconnect
the actual value from the code that uses it.

The copy in the window-list extension just uses the strings directly,
do the same here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
9c97f01bc2 window-list: Handle changes to workspace menu
For now the menu is always set at construction time, however this
will change in the future. Prepare for that by handling the
`menu-set` signal, similar to the top bar.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
8693a8a74c window-list: Externally adjust workspace menu
In order to use a PanelMenu.Button in the bottom bar, we have
to tweak its menu a bit.

We currently handle this inside the indicator, but that means the
code diverges from the original code in the workspace-indicator
extension.

Avoid this by using a small subclass that handles the adjustments.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
47c12c6279 window-list: Override base style class
Apply the changes from the last commit to the workspace-indicator
copy, and override the base style class from the extension.

This will eventually allow us to share the exact same code between
the two extensions, but still use individual styling if necessary.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
e96015b9ea workspace-indicator: Allow overriding base style class
This will allow reusing the code from the window-list extension
without limiting the ability to specify styling that only applies
to one of the extensions.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
d3debab713 window-list: Use consistent style class prefix
This will eventually allow us to re-use the workspace-indicator
extension without changing anything but the used prefix.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
00045b7396 workspace-indicator: Use descendant style selectors
Add a style class to the indicator itself, and only select
descendant elements. This allows using the briefer class names
from the window-list extension without too much risk of conflicts.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00
Florian Müllner
19877302a6 workspace-indicator: Move indicator code into separate file
Shortly after the window-list extension was added, it gained a
workspace switcher based on the workspace indicator extension.

Duplicating the code wasn't a big issue while the switcher was
a simple menu, but since it gained previews with a fair bit of
custom styling, syncing changes between the two extensions has
become tedious, in particular as the two copies have slightly
diverged over time.

In order to allow the two copies to converge again, the indicator
code needs to be separate from the extension boilerplate, so
split out the code into a separate module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
2024-04-24 14:19:51 +00:00