207 lines
4.9 KiB
QML
207 lines
4.9 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
|
|
}
|
|
|
|
|
|
BarLeft {
|
|
id: leftRect
|
|
}
|
|
|
|
|
|
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 }
|
|
}
|
|
}
|
|
|
|
BarTop {
|
|
id: midFO
|
|
x: root.screen.width / 2 - width / 2
|
|
y: topRect.y + topRect.height - 1
|
|
window: root
|
|
radius: root.radius
|
|
}
|
|
|
|
}
|