diff options
| author | coast <coasteen@proton.me> | 2026-09-07 07:07:22 +0330 |
|---|---|---|
| committer | coast <coasteen@proton.me> | 2026-09-07 07:07:22 +0330 |
| commit | 7922ded35ff292e485c3369dab9726b9142ce526 (patch) | |
| tree | ea47cb7bb569b5fb8c44ede3357f1a8b4b41722c /home-configuration/config/quickshell/modules/bar/Bar.qml | |
| parent | a7cdf9580a901ed65f179417f6ed8a0848491b66 (diff) | |
| download | nix-7922ded35ff292e485c3369dab9726b9142ce526.tar.gz nix-7922ded35ff292e485c3369dab9726b9142ce526.tar.bz2 nix-7922ded35ff292e485c3369dab9726b9142ce526.tar.xz nix-7922ded35ff292e485c3369dab9726b9142ce526.tar.zst | |
a lot of quickshell
Diffstat (limited to 'home-configuration/config/quickshell/modules/bar/Bar.qml')
| -rw-r--r-- | home-configuration/config/quickshell/modules/bar/Bar.qml | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/home-configuration/config/quickshell/modules/bar/Bar.qml b/home-configuration/config/quickshell/modules/bar/Bar.qml new file mode 100644 index 0000000..3fc6b36 --- /dev/null +++ b/home-configuration/config/quickshell/modules/bar/Bar.qml @@ -0,0 +1,154 @@ +import QtQuick +import QtQuick.Layouts +import Quickshell +import "../../config.js" as Config + +PanelWindow { + id: bar + + anchors { + top: true + left: true + right: true + } + + implicitHeight: Config.barHeight + color: "transparent" + + Rectangle { + id: content + + anchors.fill: parent + color: Config.barBackground + opacity: 0 + y: -Config.barHeight + + RowLayout { + anchors { + left: parent.left + leftMargin: Config.barMargin + verticalCenter: parent.verticalCenter + } + + spacing: Config.workspaceSpacing + + Loader { + active: true + sourceComponent: Workspaces {} + } + } + + Rectangle { + anchors { + horizontalCenter: parent.horizontalCenter + verticalCenter: parent.verticalCenter + } + + height: Config.blockHeight + width: windowTitle.contentWidth + Config.blockPadding + radius: Config.blockRadius + color: "transparent" + + Text { + id: windowTitle + + anchors.centerIn: parent + + text: niri.focusedWindow?.title ?? "" + + color: Config.textWindow + + font.family: Config.fontFamily + font.pixelSize: Config.fontSize + font.bold: true + + elide: Text.ElideRight + } + } + + RowLayout { + id: rightLayout + + anchors { + right: parent.right + rightMargin: Config.barMargin + verticalCenter: parent.verticalCenter + } + + spacing: Config.workspaceSpacing + + Loader { + active: true + sourceComponent: Music {} + } + + Loader { + active: true + sourceComponent: Time {} + } + + Loader { + active: true + sourceComponent: QuickControl {} + } + } + } + + ParallelAnimation { + id: showAnimation + + NumberAnimation { + target: content + property: "y" + from: -Config.barHeight + to: 0 + duration: Config.barAnimationDuration + easing.type: Easing.OutCubic + } + + NumberAnimation { + target: content + property: "opacity" + from: 0 + to: 1 + duration: Config.barAnimationDuration + easing.type: Easing.OutCubic + } + } + + ParallelAnimation { + id: hideAnimation + + NumberAnimation { + target: content + property: "y" + from: 0 + to: -Config.barHeight + duration: Config.barAnimationDuration + easing.type: Easing.InCubic + } + + NumberAnimation { + target: content + property: "opacity" + from: 1 + to: 0 + duration: Config.barAnimationDuration + easing.type: Easing.InCubic + } + + onFinished: { + showAnimation.start() + } + } + + Component.onCompleted: { + showAnimation.start() + } + + function restart() { + showAnimation.stop() + hideAnimation.stop() + hideAnimation.start() + } +} |
