diff --git a/quickshell/Modules/Settings/DDashTab.qml b/quickshell/Modules/Settings/DDashTab.qml index 81ce22ff5..517ccb9b1 100644 --- a/quickshell/Modules/Settings/DDashTab.qml +++ b/quickshell/Modules/Settings/DDashTab.qml @@ -18,6 +18,23 @@ FocusScope { readonly property var tabs: DashRegistry.tabEntries readonly property var optionEntryIds: DashRegistry.entries.filter(e => (e.options?.length ?? 0) > 0).map(e => e.id) + + function showDashPluginBrowser() { + dashPluginBrowserLoader.active = true; + if (dashPluginBrowserLoader.item) + dashPluginBrowserLoader.item.show(); + } + + LazyLoader { + id: dashPluginBrowserLoader + active: false + + PluginBrowser { + parentModal: root.parentModal + typeFilters: ["dash-tab", "dash-card"] + } + } + SettingsPage { SettingsCard { title: I18n.tr("Weather") @@ -203,5 +220,14 @@ FocusScope { } } } + + SettingsFabBar { + DFab { + text: I18n.tr("Browse plugins") + iconName: "store" + colorRole: "secondaryContainer" + onClicked: root.showDashPluginBrowser() + } + } } } diff --git a/quickshell/Modules/Settings/DesktopWidgetsTab.qml b/quickshell/Modules/Settings/DesktopWidgetsTab.qml index 16078473d..f9b9008c4 100644 --- a/quickshell/Modules/Settings/DesktopWidgetsTab.qml +++ b/quickshell/Modules/Settings/DesktopWidgetsTab.qml @@ -90,7 +90,7 @@ Item { PluginBrowser { parentModal: root.parentModal - typeFilter: "desktop-widget" + typeFilters: ["desktop-widget"] } } diff --git a/quickshell/Modules/Settings/LockScreenTab.qml b/quickshell/Modules/Settings/LockScreenTab.qml index 1586a5f5e..c3684ff12 100644 --- a/quickshell/Modules/Settings/LockScreenTab.qml +++ b/quickshell/Modules/Settings/LockScreenTab.qml @@ -297,7 +297,7 @@ Item { PluginBrowser { parentModal: root.parentModal - typeFilter: "desktop-widget" + typeFilters: ["desktop-widget"] } } diff --git a/quickshell/Modules/Settings/PluginBrowser.qml b/quickshell/Modules/Settings/PluginBrowser.qml index 0341889cb..d25a5c4e0 100644 --- a/quickshell/Modules/Settings/PluginBrowser.qml +++ b/quickshell/Modules/Settings/PluginBrowser.qml @@ -16,7 +16,7 @@ RegistryBrowserWindow { readonly property var log: Log.scoped("PluginBrowser") property var allPlugins: [] property var filteredPlugins: [] - property string typeFilter: "" + property var typeFilters: [] property string categoryFilter: "all" property var categoryFilterOptions: [] property var availableLetters: [] @@ -38,7 +38,7 @@ RegistryBrowserWindow { readonly property var detailPlugin: resolveDetailPlugin(detailPluginId, allPlugins) readonly property bool discoverVisible: { - if (isLoading || loadError !== "" || searchQuery !== "" || typeFilter !== "" || authorFilter !== "") + if (isLoading || loadError !== "" || searchQuery !== "" || typeFilters.length > 0 || authorFilter !== "") return false; if (discoverPicks.length === 0 && discoverShelves.length === 0) return false; @@ -71,6 +71,37 @@ RegistryBrowserWindow { ] showLoadingSpinner: false + readonly property var typeFilterOptions: [ + { + label: I18n.tr("Bar", "plugin browser type filter chip, bar widget plugins"), + value: "dankbar-widget" + }, + { + label: I18n.tr("Control Center", "plugin browser type filter chip"), + value: "control-center" + }, + { + label: I18n.tr("Launcher", "plugin browser type filter chip"), + value: "launcher" + }, + { + label: I18n.tr("Daemon", "plugin browser type filter chip, background plugins"), + value: "daemon" + }, + { + label: I18n.tr("Desktop", "plugin browser type filter chip, desktop widget plugins"), + value: "desktop-widget" + }, + { + label: I18n.tr("Dash tab", "plugin browser type filter chip"), + value: "dash-tab" + }, + { + label: I18n.tr("Dash card", "plugin browser type filter chip"), + value: "dash-card" + } + ] + readonly property var sortChipOptions: [ { id: "hideInstalled", @@ -389,8 +420,8 @@ RegistryBrowserWindow { if (!SessionData.showThirdPartyPlugins && !isFirstParty) continue; - if (typeFilter !== "") { - var hasCapability = plugin.capabilities && plugin.capabilities.includes(typeFilter); + if (typeFilters.length > 0) { + var hasCapability = typeFilters.some(type => (plugin.capabilities || []).includes(type)); if (!hasCapability) continue; } @@ -763,7 +794,7 @@ RegistryBrowserWindow { return; pendingRevealPluginId = pluginId; searchQuery = ""; - typeFilter = ""; + typeFilters = []; categoryFilter = "all"; detailPluginId = ""; SessionData.setPluginBrowserHideInstalled(false); @@ -961,6 +992,17 @@ RegistryBrowserWindow { root.updateFilteredPlugins(); } } + DFilterChips { + width: parent.width + model: root.typeFilterOptions + multiSelect: true + selectedValues: root.typeFilters + onSelectionToggled: (index, selected) => { + var value = model[index].value; + root.typeFilters = selected ? root.typeFilters.concat([value]) : root.typeFilters.filter(type => type !== value); + root.updateFilteredPlugins(); + } + } DButton { visible: root.authorFilter !== "" text: I18n.tr("Plugins by %1", "plugin browser author filter, %1 is the author").arg(root.authorFilter)