Files
Aurora/config/aurora/modules/Bar.qml
2026-03-06 08:06:15 -06:00

284 lines
6.5 KiB
QML

import Quickshell // for PanelWindow
import QtQuick // for Text
import QtQuick.Shapes
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell.Io
import Quickshell.Widgets
import Quickshell.Wayland
import Quickshell.Hyprland
PanelWindow {
property real radius: 20
onClosed: {
Hyprland.dispatch("exec hyprctl keyword monitor eDP-1,addreserved,0,100,0,0")
}
anchors {
top: true
left: true
right: true
bottom: true
}
Component.onCompleted: {
//Hyprland.dispatch("exec hyprctl keyword monitor eDP-1,addreserved," + topRect.height + "," + botRect.height + "," + leftRect.width + "," + rightRect.width)
Hyprland.dispatch("exec hyprctl keyword monitor eDP-1,addreserved," + topEx + "," + botEx + "," + leftEx + "," + rightEx)
}
property int topEx: topRect.height
property int botEx: botRect.height
property int leftEx: leftRect.width
property int rightEx: rightRect.width
id: root
exclusionMode: ExclusionMode.Ignore
WlrLayershell.layer: WlrLayer.Top
//color: Pywal.special.background
color: "transparent"
mask: Region {
Region {
item: topRect
}
Region {
item: leftRect
}
Region {
item: midFO.visible ? midFO : topRect
//item: midFO
}
}
WrapperMouseArea {
id: topRectArea
Rectangle {
id: topRect
color: Pywal.special.background
anchors.fill: parent
}
implicitHeight: 10
implicitWidth: parent.width
hoverEnabled: true
onEntered: {
midFO.set = !midFO.set
midFO.visible = Qt.binding(() => midFO.set)
}
//onEntered: midFO.visible = true
}
Rectangle {
id: botRect
y: parent.height - height
color: Pywal.special.background
implicitHeight: 10
implicitWidth: parent.width
}
Rectangle {
id: leftRect
implicitHeight: parent.height
implicitWidth: 40
color: Pywal.special.background
Launcher {
id: launcher
x: parent.width / 2 - implicitWidth / 2
y: implicitWidth / 3
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
}
Workspaces {
id: workspaces
x: parent.width / 2 - implicitWidth / 2
y: 20 + launcher.y + launcher.height
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
}
IdleInhibitor {
id: idleInhibitor
x: parent.width / 2 - implicitWidth / 2
y: 20 + workspaces.y + workspaces.height
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
visible: false
}
}
Rectangle {
id: rightRect
x: parent.width - width
color: Pywal.special.background
implicitWidth: 10
implicitHeight: parent.height
}
Shape {
x: leftRect.x + leftRect.width - 1
y: topRect.y + topRect.height - 1
ShapePath {
strokeWidth: 4
strokeColor: Pywal.special.background
fillColor: Pywal.special.background
startX: 0; startY: 0
onFillColorChanged: {
console.log(Pywal.special.background)
fillColor = Qt.binding(() => Pywal.special.background)
strokeColor = Qt.binding(() => Pywal.special.background)
}
PathLine { relativeX: 0; relativeY: radius }
PathArc {
radiusX: radius
radiusY: -radius
relativeX: radius
relativeY: -radius
}
PathLine { relativeX: -radius; relativeY: 0 }
}
}
Shape {
x: rightRect.x + 1
y: topRect.y + topRect.height - 1
ShapePath {
strokeWidth: 4
strokeColor: Pywal.special.background
fillColor: Pywal.special.background
startX: 0; startY: 0
PathLine { relativeX: 0; relativeY: radius }
PathArc {
direction: PathArc.Counterclockwise
radiusX: radius
radiusY: radius
relativeX: -radius
relativeY: -radius
}
PathLine { relativeX: radius; relativeY: 0 }
}
}
Shape {
x: leftRect.x + leftRect.width - 1
y: botRect.y + 1
ShapePath {
strokeWidth: 4
strokeColor: Pywal.special.background
fillColor: Pywal.special.background
startX: 0; startY: 0
PathLine { relativeX: 0; relativeY: -radius }
PathArc {
direction: PathArc.Counterclockwise
radiusX: radius
radiusY: radius
relativeX: radius
relativeY: radius
}
PathLine { relativeX: -radius; relativeY: 0 }
}
}
Shape {
x: rightRect.x + 1
y: botRect.y + 1
ShapePath {
strokeWidth: 4
strokeColor: Pywal.special.background
fillColor: Pywal.special.background
startX: 0; startY: 0
PathLine { relativeX: 0; relativeY: -radius }
PathArc {
radiusX: radius
radiusY: -radius
relativeX: -radius
relativeY: radius
}
PathLine { relativeX: radius; relativeY: 0 }
}
}
VFlyout {
id: midFO
x: root.screen.width / 2 - width / 2
y: topRect.y + topRect.height - 1
color: Pywal.special.background
visible: set
property bool set: true
item: mid
RowLayout {
id: mid
Notifications {
id: notifications
window: root
}
Battery {
window: root
popupOffset: x + midFO.x
}
Tray {
window: root
popupOffset: x + midFO.x
}
Clock {
id: clock
}
Bluetooth {
window: root
popupOffset: x + midFO.x
}
Volume {
window: root
popupOffset: x + midFO.x
}
Power {
id: power
window: root
popupOffset: x + midFO.x
}
}
radius: radius
}
}