summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-10-27 20:25:35 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-10-27 20:25:35 +0800
commit468a145514756f6bd4ed7a2f35b5b62657df8994 (patch)
tree372ab5174d00a2295f5d993484da5a74827425a3
parent0921aaaee9d2dfda81bd3db6cccac2c5dba9821c (diff)
Launcher: launch position sync with bar centermain
-rw-r--r--SharedState.qml9
-rw-r--r--bar/Bar.qml6
-rw-r--r--popups/launcher/Launcher.qml17
3 files changed, 27 insertions, 5 deletions
diff --git a/SharedState.qml b/SharedState.qml
new file mode 100644
index 0000000..24ddd11
--- /dev/null
+++ b/SharedState.qml
@@ -0,0 +1,9 @@
+pragma Singleton
+import Quickshell
+import QtQuick
+
+Singleton {
+ id: root
+
+ property int centerBarWidth
+}
diff --git a/bar/Bar.qml b/bar/Bar.qml
index 2ad13d1..372f6f4 100644
--- a/bar/Bar.qml
+++ b/bar/Bar.qml
@@ -3,6 +3,8 @@ import Quickshell
import QtQuick.Layouts
import qs.components
import qs.config
+import "../popups/launcher"
+import ".."
Scope {
id: root
@@ -84,6 +86,10 @@ Scope {
ActiveWindow {
id: activeWindow
width: Math.min(implicitWidth, child.width - Math.max(leftRow.width, rightRow.width) * 2 - Bar.leftMargin - Bar.rightMargin) // we don't do child.width - leftRow.width - rightRow.width because left and right width isn't symetric, and we're centered meaning we will colide into the larger width side
+ // i could do implicitWidth but that wouldnt be the immediate width
+ onWidthChanged: {
+ SharedState.centerBarWidth = width;
+ }
}
}
diff --git a/popups/launcher/Launcher.qml b/popups/launcher/Launcher.qml
index 93aa0e0..c6673b7 100644
--- a/popups/launcher/Launcher.qml
+++ b/popups/launcher/Launcher.qml
@@ -5,8 +5,8 @@ import QtQuick.Layouts
import "components"
import qs.components
import qs.config
+import "../.."
-// TODO: currently, we're relying on the compositor to provide the animation which ig is fine, but we should use our own in the future, however it might look weird combined with the compositors's
ILauncher {
id: launcher
@@ -23,6 +23,7 @@ ILauncher {
id: container
property var selection: launcher.state?.selected
property var mappedSelection: selection?.mapToItem(null, 0, 0)
+ property real openProgress: 0
onMappedSelectionChanged: {
// launcher.state?.selected may be slow.. smh qt
@@ -88,9 +89,15 @@ ILauncher {
color: Qt.rgba(Colors.background3.r, Colors.background3.g, Colors.background3.b, Launcher.bgTransparency)
radius: Launcher.borderRadius
- width: Math.max(root.width, Launcher.defaultWidth) + Launcher.innerMargin
+ width: SharedState.centerBarWidth + (Math.max(root.width, Launcher.defaultWidth) + Launcher.innerMargin - SharedState.centerBarWidth) * openProgress
height: root.height
+ ISpringAnimation on openProgress {
+ from: 0
+ to: 1
+ running: true
+ }
+
IRect {
id: root
property alias input: textInput.text
@@ -131,11 +138,11 @@ ILauncher {
property bool pendingUpdate: false
Keys.onPressed: event => {
if (event.key === Qt.Key_End || event.key === Qt.Key_Home) {
- if (event.key === Qt.Key_End) {
+ if (event.key === Qt.Key_End)
endShortcut.activated();
- } else if (event.key === Qt.Key_Home) {
+ else if (event.key === Qt.Key_Home)
homeShortcut.activated();
- }
+
event.accepted = true;
}
}