From 40a255283083301b9503e1cbb9f0ea7db83e069a Mon Sep 17 00:00:00 2001 From: Bora Gülerman <49169566+eratoriele@users.noreply.github.com> Date: Thu, 19 Feb 2026 13:26:10 +0300 Subject: launcher: add favorite apps (#946) * launcher: add favorite apps Favorite apps always appear above non-favorite apps Accepts regex, same logic as #920 Added the same regex logic to hidden apps Added util file may need to be relocated * addressed requested changes * fix: Renamed newly added util singleton Also added a null check to favorite icon loader in AppItem.qml * controlCenter/launcherPane: added favorite apps added icons to the app list to indicate if they are favorited/hidden marking as favorite/hidden is desabled if the other is selected * favouriteApps: renamed from favorite to favourite Also disabled favorite/hidden switch for entries added as regex * appDb: added notify and emit to favoriteApps * controlCentre/Launcher: Fixed bug with favourite switch not enabling itself when no hiddenApps exist Added a comment to explain the enabled state of the switches icon loader is now a single loader rather than two, hidden icon has priority * spelling mistakes * fixed warning * formatting fixes --- modules/launcher/items/AppItem.qml | 19 +++++++++++++++++-- modules/launcher/services/Apps.qml | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'modules/launcher') diff --git a/modules/launcher/items/AppItem.qml b/modules/launcher/items/AppItem.qml index 48aace7..2bd818d 100644 --- a/modules/launcher/items/AppItem.qml +++ b/modules/launcher/items/AppItem.qml @@ -2,6 +2,7 @@ import "../services" import qs.components import qs.services import qs.config +import qs.utils import Quickshell import Quickshell.Widgets import QtQuick @@ -46,7 +47,7 @@ Item { anchors.leftMargin: Appearance.spacing.normal anchors.verticalCenter: icon.verticalCenter - implicitWidth: parent.width - icon.width + implicitWidth: parent.width - icon.width - favouriteIcon.width implicitHeight: name.implicitHeight + comment.implicitHeight StyledText { @@ -64,10 +65,24 @@ Item { color: Colours.palette.m3outline elide: Text.ElideRight - width: root.width - icon.width - Appearance.rounding.normal * 2 + width: root.width - icon.width - favouriteIcon.width - Appearance.rounding.normal * 2 anchors.top: name.bottom } } + + Loader { + id: favouriteIcon + + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + active: modelData && Strings.testRegexList(Config.launcher.favouriteApps, modelData.id) + + sourceComponent: MaterialIcon { + text: "favorite" + fill: 1 + color: Colours.palette.m3primary + } + } } } diff --git a/modules/launcher/services/Apps.qml b/modules/launcher/services/Apps.qml index c409a7b..7f2d645 100644 --- a/modules/launcher/services/Apps.qml +++ b/modules/launcher/services/Apps.qml @@ -72,6 +72,7 @@ Searcher { id: appDb path: `${Paths.state}/apps.sqlite` - entries: DesktopEntries.applications.values.filter(a => !Config.launcher.hiddenApps.includes(a.id)) + favouriteApps: Config.launcher.favouriteApps + entries: DesktopEntries.applications.values.filter(a => !Strings.testRegexList(Config.launcher.hiddenApps, a.id)) } } -- cgit v1.2.3-freya