AppLauncher

This commit is contained in:
quadbyte 2025-08-20 11:01:06 -04:00
parent 524135800e
commit c0a068ddc0
3 changed files with 15 additions and 22 deletions

View file

@ -12,15 +12,12 @@ import qs.Widgets
import "../../Helpers/FuzzySort.js" as Fuzzysort
NLoader {
id: appLauncher
isLoaded: false
content: Component {
NPanel {
id: appLauncherPanel
id: root
panelWidth: Math.min(700 * scaling, screen?.width * 0.75)
panelHeight: Math.min(550 * scaling, screen?.height * 0.8)
panelAnchorCentered: true
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
// Import modular components
Calculator {
@ -158,7 +155,7 @@ NLoader {
} else {
modelData.execute()
}
appLauncherPanel.hide()
root.close()
}
}
@ -174,14 +171,7 @@ NLoader {
}
// Main content container
Rectangle {
anchors.centerIn: parent
width: Math.min(700 * scaling, parent.width * 0.75)
height: Math.min(550 * scaling, parent.height * 0.8)
radius: Style.radiusL * scaling
color: Color.mSurface
border.color: Color.mOutline
border.width: Style.borderS * scaling
panelContent: Rectangle {
// Subtle gradient background
gradient: Gradient {
@ -262,7 +252,7 @@ NLoader {
Keys.onUpPressed: selectPrev()
Keys.onEnterPressed: activateSelected()
Keys.onReturnPressed: activateSelected()
Keys.onEscapePressed: appLauncherPanel.hide()
Keys.onEscapePressed: root.close()
}
}
@ -453,5 +443,3 @@ NLoader {
}
}
}
}
}

View file

@ -134,6 +134,10 @@ Rectangle {
function open() {
visible = true
// Register into the panel service
// so this will autoclose if we open another panel
PanelService.registerOpen(trayPanel)
}
function close() {

View file

@ -1,4 +1,5 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Services
@ -9,7 +10,7 @@ Item {
target: "settings"
function toggle() {
settingsPanel.isLoaded = !settingsPanel.isLoaded
settingsPanel.toggle(Quickshell.screens[0])
}
}
@ -17,7 +18,7 @@ Item {
target: "notifications"
function toggleHistory() {
notificationHistoryPanel.isLoaded = !notificationHistoryPanel.isLoaded
notificationHistoryPanel.toggle(Quickshell.screens[0])
}
function toggleDoNotDisturb() {// TODO
@ -36,7 +37,7 @@ Item {
target: "appLauncher"
function toggle() {
appLauncherPanel.isLoaded = !appLauncherPanel.isLoaded
appLauncherPanel.toggle(Quickshell.screens[0])
}
}