825 Commits

Author SHA1 Message Date
a48171ffd0 Avoid negative page values 2025-04-07 13:51:03 +00:00
Florian Müllner
c0e3dfd166 data: Add "System" default folder
The "Utilities" folder is potentially getting quite crowded,
so set up an additional "System" folder. It will be populated
in a follow-up commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3642>
2025-02-26 13:09:16 +00:00
Florian Müllner
852a0a89ac appDisplay: Filter apps in default folder
We currently create the default folder with the corresponding
app list, regardless of whether the apps are actually part of
the default install or not.

This matters when a user explicitly install such an app later,
as it will be hidden away in the folder rather than appended
to the app grid as expected.

To avoid that, only add currently-installed apps to the folder
when creating it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3632>
2025-02-13 19:59:17 +00:00
Florian Müllner
38c6293f4f data: Generate dash/app-grid defaults from text files
Defining default apps as serialized GVariants isn't very human-friendly,
which likely contributes to the fact that the lists are in parts horribly
outdated (Books! Cheese! Screenshot! gedit!).

Instead, generate the lists at build time from simple text files, which
should be much easier to update.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3632>
2025-02-13 19:59:17 +00:00
Florian Müllner
b75b4abaf0 js: Set BoxLayout orientation
Use new `orientation` property instead of `vertical`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Adam Williamson
4bef27d85c data: Correct Utilities category ordering, add comments
This adds a comment to make clear that the Utilities category is
intended to be organized alphabetically by the display name of
the apps (*not* by the desktop file names), and adds comments
with the current display name of each app.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3609>
2025-01-23 16:28:04 -08:00
Adam Williamson
ca136d1c62 data: List Characters and Logs in the Utilities group
These have (Logs) or previously had (Characters) the
X-GNOME-Utilities category in their .desktop file and so showed
up in the Utilities folder (despite 152faae claiming that the
category was "completely unused"). Characters had the category
removed in
https://gitlab.gnome.org/GNOME/gnome-characters/-/commit/210eb09
in apparent expectation that it would be added to the list, but
it seems it was not.

We could restore consideration of the category, but I guess let's
just list the apps instead? I don't know if any others are
missing.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3607>
2025-01-21 14:54:01 -08:00
AsciiWolf
5057a7fe0e appDisplay: Add org.freedesktop.MalcontentControl to Utilities
malcontent-control is now a standalone app that is displayed in Shell Overview.
Let's place it in the Utilities folder instead of taking up space (and confusing users)
in the main app grid

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8124
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3579>
2025-01-04 16:09:09 +00:00
Daniel Rusek
de4f1c3f9f appDisplay: Remove deprecated apps from Utilities, fix desktop file name
gnome-system-log, vinagre and gnome-dictionary were deprecated a long time ago

The gnome-abrt desktop file name was also changed a long time ago to a rDNS one

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3539>
2024-11-23 13:35:02 +00:00
Daniel Rusek
b3c16a48ca appDisplay: Fix Fonts desktop file name
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3532>
2024-11-06 19:24:44 +00:00
Pablo Correa Gómez
152faae6f9 data: Add X-GNOME-Shell-Utilities.directory file to allow showing real name
Instead of having the name of the directory be X-GNOME-Utilities. This
also allows translating the name to the user's language. The name is
chose to be different to X-GNOME-Utilities from GNOME Menus.

In the process, also remove the categories. The menu definition from
gnome-menus is not used, and it's not a category that apps list
themselves, so it's completely unused anyway.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3526>
2024-11-04 20:46:29 +01:00
Bilal Elmoussaoui
aa0f2c4915 Use NULL for nick/blurb in GObject params
As they are only used by gstreamer for gst-inspect & other tools.
Projects like Mutter/gtk have completely dropped them as well, so follow
their path

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3505>
2024-10-16 10:19:41 +00:00
Florian Müllner
105abab1e4 js: 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/-/merge_requests/3431>
2024-07-30 18:20:55 +00:00
sorelz
9569239ec5 appDisplay: Use AppFolderDialog grabHelper to obtain key focus on popup()
When an app folder is opened it would do so without grabbing the
keyboard focus, so one could not navigate with the arrow keys without
pressing Tab. This adds the focus parameter to popup()'s grab, which
sets the key focus to the elements of the folder when it is opened.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3338>
2024-07-21 14:24:57 -04:00
sorelz
a04b35b569 appDisplay: Use navigate_focus() to keep focus after editing app folder title
The AppFolderDialog would lose keyboard focus after editing the title
(likely due to the folder entry grabbing key focus). This commit adds
navigate_focus() to _showFolderLabel() to send key focus back to the
dialog's elements after editing the title.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3338>
2024-07-21 14:24:57 -04:00
sorelz
3061589610 appDisplay: Use navigate_from_event() for keyboard focus in app folders
It wasn't possible to navigate by keyboard inside app folders due
to the focus being grabbed by the dialog. Changed vfunc_key_press_event()
to use the focus manager's navigate_from_event(), which is the same method
used by modal dialogs (also making use of the focus group already assigned
to AppFolderDialog).

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6331
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3338>
2024-07-21 14:24:57 -04:00
Bilal Elmoussaoui
7f0b1e98cf cleanup: Adapt to removed ClutterColor
It was replaced by CoglColor

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3142>
2024-06-13 18:29:13 +00:00
Bilal Elmoussaoui
4b3bbc50ff cleanup: Prefer using Color struct constructor
Instead of Color.from_pixel or Color.new as both would be removed
to simplify the Color API

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3367>
2024-06-12 16:09:43 +00:00
Sebastian Keller
31997fa2f9 appDisplay: Set running indicator dot offset via CSS
The offset was given as a hardcoded (physical) pixel value and did not
take scaling into account. This lead to it being shifted closer towards
the icon as the scale increased.

This now replaces the hardcoded value with a CSS property which
automatically includes the scale factor.

Further this allows simplifying some calculations that previously were
trying to counteract the hardcoded offset using margins by using the
intended offset directly.

With this the dot in the dash is also now placed at exactly the bottom
of the hover highlight, while previously there was an unintentional 1px
space.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7488
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3245>
2024-05-22 19:02:42 +00:00
Jonas Dreßler
bdb0fc6b14 appDisplay: Don't add row and column spacing to the pagePadding
We use the pagePadding to adjust for the large indicators that we add on the
left and right of the appGrid.

While the original padding needs to be applied to the padding for the
indicators (as it was in super.vfunc_style_changed already), there's no
reason to add an extra row and column spacing to the pagePadding on all
sides, so remove that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3278>
2024-05-14 18:24:07 +00:00
Florian Müllner
fe1eab1b3c cleanup: Also replace Params.parse(..., true) with spread
This is what Params.parse() boils down to when accepting extra
parameters, so we can just as well use standard syntax here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3196>
2024-02-17 12:02:25 +01:00
Florian Müllner
fbc7290bcf appDisplay: Remove shellWorkspaceLaunch()
It was deprecated in commit 942758bb308 back in 2019.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Sam Hewitt
15e0440a8b appDisplay: CSS cleanup & fixes for app dialog
- change the container and dialog actor alignments
- pad the container to not have dialog overlap panel
- clean up extraneous app-folder css

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3044>
2024-01-09 17:14:09 +00:00
Sam Hewitt
745667a825 style: Rewrote app grid tile drawing functions
- updated mixin for tile_button
- dropped the overview_button mixin
- minor changes to dash, appDisplay and switcherPopup JS to accommodate new stylesheet
- new focus style for all tile buttons
- improved high contrast style support for app grid and dash
- renamed some style-classes
- tidied up dash stylesheet

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3017>
2023-12-14 18:30:52 +00:00
Sam Hewitt
49c0b849c4 style: Improve text scaling support
- new drawing function to convert px to em, for select instances
- updated fontsize function to convert fonts in pt to em
- replace instances of discrete sizes with defined values
- fix instances where assets or icons did not scale along with text
- rework panel buttons to accommodate the scaling padding and icons
- new 'scalable' definitions for elements that follow text scaling

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3033>
2023-12-05 12:14:53 +00:00
Florian Müllner
998d703bc2 js: Stop using {v,h}scroll properties
We only use them to access the corresponding adjustments, and
ScrollView now exposes those directly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Zander Brown
49cca32ca5 js: Cleanup usage of StScrollView
Whilst you *can* use add_actor() with ScrollView, it's more idiomatic to
work on :child

Cleanup a few extras along the way

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Zander Brown
350cd296fa js: Stop using ClutterContainer API
These have been long deprecated over in clutter, and (via several
vtables) simply forward the call to the equivalent ClutterActor methods

Save ourselves the hassle and just use ClutterActor methods directly

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Sebastian Keller
9153876764 search: Allow grid using search providers to specify maximum of results
When GridSearchResults::_getMaxDisplayedResults() is called after the
first character has been entered in the search, GridSearchResults has
no children yet. _getMaxDisplayedResults() tries to determine the
maximum number of search results based on how often the largest child
would fit into the allocated size or -1 (i.e. no limit) if there are no
children. So for the initial search there is no limit and in the app
search all matching apps get added as possible results, which due to the
search term being only a single character is almost all installed apps.
This now causes allocation to be run for all these results, despite the
vast majority of them never being visible, which on slower machines can
cause noticeable delays before the search results are displayed.

This now adds the ability for search providers to specify a maximum
number of results that gets used instead of -1 when specified. By being
provider specific this means extensions implementing their own providers
will not be affected by this.

Further this sets the maximum for the app search provider to 6 as per
the current designs.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7155
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3004>
2023-11-03 20:39:28 +00:00
aliriza
d94f7dae1d appDisplay: Add Pardus apps to default folder list
Those are distro-specific apps like YaST on Suse.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2875>
2023-09-02 16:55:36 +00:00
kramo
bd5aa95ecb appDisplay: Replace EOG with Loupe in 'Utilities' folder
Loupe replaced EOG in core apps, update the 'Utilities' folder
accordingly.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2916>
2023-08-29 22:03:56 +00:00
Florian Müllner
a42f7c2384 cleanup: Use type-safe comparisons
We have been using type-safe comparisons in new code for quite a while
now, however old code has only been adapted slowly.

Change all the remaining bits to get rid of another legacy style
difference.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:38 +00:00
Florian Müllner
071f92cfb6 cleanup: Remove spaces in object literals
We only adopted this style relatively recently, so there's a bit
more to adjust. Still, it's manageable and another step towards
getting rid of the legacy style.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:37 +00:00
Florian Müllner
6a22af83dc cleanup: Always use single quotes
We have made good progress with transitioning to the new style,
to the point where we can complete it with a final push.

Start with changing the remaining places that still use double
quotes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:37 +00:00
Carlos Garnacho
8423ba44fe js: Mass move to Clutter.Event getter methods in Clutter.Actor vfuncs
These traditionally got the various ClutterEvent subtype structs as their
argument, so it was not allowed to use ClutterEvent generic getter methods
in these vfuncs. These methods used direct access to struct fields instead.

This got spoiled with the move to make ClutterEvent opaque types, since
these are no longer public structs so GNOME Shell most silently failed to
fetch the expected values from event fields. But since they are not
ClutterEvents either, the getters could not be used on them.

Mutter is changing so that these vmethods all contain an alias to the
one and only Clutter.Event type, thus lifting those barriers, and making
it possible to use the ClutterEvent methods in these vfuncs.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2950
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2872>
2023-08-09 13:46:08 +02:00
Evan Welsh
a751e213f6 js: Port to modules
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1499>
2023-08-06 13:02:49 +02:00
Evan Welsh
0705c7a4eb js: Fix linting errors from line shifts
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2794>
2023-06-21 04:50:33 -07:00
Evan Welsh
1e9b906cbc js: Split gi imports to be on new lines to prepare for ES modules
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2794>
2023-06-21 04:50:33 -07:00
Daniel van Vugt
b8013704cf appDisplay: Avoid using an undefined _swipeTracker
It might have been deleted already during shutdown by `_onDestroy()`.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6512
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2693>
2023-03-19 13:12:22 +00:00
Jonas Dreßler
4920cf1eb6 appDisplay: Remove pan gesture from FolderView
The FolderView is a subclass of BaseAppView, which already has a
full-blown SwipeTracker attached to it. So no need to add another
PanGesture on top, the SwipeTracker will handle it for us.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2318>
2023-02-24 15:32:06 +00:00
sunflowerskater
2d00320a4b general: Rename "application" to "app"
Several places in Shell use the word "application". However,"app"
is a more common term nowadays, so update strings accordingly.

https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/123
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6202

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2614>
2023-02-07 14:46:28 +00:00
Jonas Dreßler
7d7b99e2d3 appDisplay: Simplify loading Folder apps a bit
Instead of plugging into _redisplay(), we can use _loadApps() for this.
It's actually exactly what _loadApps() is meant for...

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2348>
2023-02-01 12:56:28 +00:00
Jonas Dreßler
2566f938e6 appDisplay: Move findBestPageToAppend() behavior to IconGrid
This behavior makes more sense to have in the iconGrid itself: When a
page is filled up with items, the new item should never go to the start
of the next page, but always to next empty slot.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2348>
2023-02-01 12:56:28 +00:00
Jonas Dreßler
245137ff35 appDisplay: Fix multi-page dragging behavior in folders
Folders reflow across pages because they don't set
allow_incomplete_pages to true. This means we want the nudging of items
to happen slightly differently when dragging an item across pages:

- When dragging from lower page index to a higher one, always reflow
towards the start of the grid (because there's now an empty slot on the
old page and items on the new page will force-reflow towards that)
- When dragging from a higher page index to a lower one, we can reflow to
the end as we usually do

To archive this, factor out the selection of "reflow direction" into a
separate variable that always defaults to "end" (because empty space is
always at the end of the grid). Set it to "start" when the item created an
empty slot on the current page or (and this is new:) on a previous page in
the folder case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2348>
2023-02-01 12:56:28 +00:00
Jonas Dreßler
40bd48068f appDisplay: Consider drag events during page-switching as invalid
While there's an ongoing animation to switch pages, we should ignore all
drag events as those will end up moving the drag item to an unwanted
position.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2348>
2023-02-01 12:56:28 +00:00
Jonas Dreßler
a69d99527d appDisplay: Consider drop targets on !currentPage as invalid
The iconGrid's getDropTarget() API supports dropping items to adjacent
pages just fine, but in the AppDisplay, we clip the grid and don't show
those adjacent pages. That doesn't stop getDropTarget() from picking
drop targets which are on adjacent pages though, so we need to filter
those out in the layer above.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2348>
2023-02-01 12:56:28 +00:00
Jonas Dreßler
2e6fd8b730 iconGrid: Return page and position for drop targets instead of items
Returning a page and a position for the drop target seems more
straightforward than returning an actual grid item in getDropTarget().

With the next commit, this will allow us to throw away drop targets that
are not on the current page.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2348>
2023-02-01 12:56:28 +00:00
Jonas Dreßler
b781b3e9fd appDisplay: Get linear index using item instead of page and position
_getLinearPosition() is a function that converts a page and position
index to the "accumulated" index that includes all pages before the
page. The function is used by _addItem() and _moveItem() for getting the
new index of an item inside the _orderedItems array.

Now when passing -1 as position to _addItem() or _moveItem(), this means
the item should be appended to the page. Right now _getLinearPosition()
returns the last item index on the page when passed -1, inserting the
item into _orderedItems at this index will actually not append it, but
insert it between the second last and last item.

To fix it, let's make the whole thing more robust by explicitly passing
an item to _getLinearPosition(). This means we simply no longer have to
assume what "-1" means. Moving the call to _getLinearPosition() to
happen after addItem() and moveItem() ensures that the new item position
is used and not the old one.

This fixes issues where the _orderedItems array gets out of order when
moving or adding items.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2348>
2023-02-01 12:56:28 +00:00
Alessandro Bono
ec6ab60e62 appDisplay: Don't assume this._placeholder always exists
Dropping a icon from the dash to the application grid will set this._placeholder
to null. However the AppIcon is still used to represent the application in the
application grid. If we click on it we emit a pressed event. Stop assuming
that this._placeholder is still valid in the callback, use the icon parameter
instead.

This fixes the following error:
```
Gjs-CRITICAL **: 18:22:39.003: JS ERROR: TypeError: this._placeholder is null
_ensurePlaceholder/<@resource:///org/gnome/shell/ui/appDisplay.js:1477:17
vfunc_button_press_event@resource:///org/gnome/shell/ui/appDisplay.js:3121:27
```

Fixes: 6fc93b78bc54763c0876951f2425fcfd96f61f00
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6317
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2606>
2023-01-16 20:24:26 +00:00
Jonas Dreßler
eacc55334f appDisplay: Disable overshoot gesture in multi-monitor setups
The "bump against monitor edge" thing can't work when there's a monitor
adjacent to the current one, so just disable the gesture in case there's
more than a single monitor.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2581>
2022-12-19 11:37:58 +00:00