usable
This commit is contained in:
@@ -0,0 +1,221 @@
|
||||
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
|
||||
|
||||
|
||||
|
||||
FloatingWindow {
|
||||
|
||||
id: root
|
||||
|
||||
property real radius: 10
|
||||
property real selected: 0
|
||||
|
||||
visible: false
|
||||
|
||||
color: Pywal.special.background
|
||||
|
||||
WrapperMouseArea {
|
||||
ClippingRectangle {
|
||||
//anchors.fill: parent
|
||||
color: Pywal.special.background
|
||||
id: main
|
||||
|
||||
radius: root.radius
|
||||
implicitWidth: root.width
|
||||
implicitHeight: root.height
|
||||
|
||||
Item {
|
||||
implicitWidth: root.width - 4 * lay.spacing
|
||||
implicitHeight: root.height - 4 * lay.spacing
|
||||
x: 2 * lay.spacing
|
||||
y: 2 * lay.spacing
|
||||
RowLayout {
|
||||
id: lay
|
||||
spacing: 2
|
||||
anchors.fill: parent
|
||||
|
||||
ColumnLayout {
|
||||
id: tabs
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Repeater {
|
||||
id: rep
|
||||
|
||||
model: 9
|
||||
|
||||
WrapperMouseArea {
|
||||
ClippingRectangle {
|
||||
//Layout.alignment: Qt.AlignTop
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
radius: root.radius
|
||||
color: index == selected ? Pywal.colors.color13 : Pywal.colors.color4
|
||||
//LauncherButton { anchors.centerIn: parent }
|
||||
Text {
|
||||
font.pointSize: 14
|
||||
text: switch(index) {
|
||||
case 0:
|
||||
return " ";
|
||||
case 1:
|
||||
return " ";
|
||||
case 2:
|
||||
return " ";
|
||||
case 3:
|
||||
return "";
|
||||
case 4:
|
||||
return " ";
|
||||
case 5:
|
||||
return " ";
|
||||
case 6:
|
||||
return " ";
|
||||
case 7:
|
||||
return " ";
|
||||
case 8:
|
||||
return "";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
anchors.centerIn: parent
|
||||
color: Pywal.colors.color0
|
||||
}
|
||||
}
|
||||
onEntered: child.color = Qt.binding(() => index == selected ? Pywal.colors.color13 : Pywal.colors.color12)
|
||||
onExited: child.color = Qt.binding(() => index == selected ? Pywal.colors.color13 : Pywal.colors.color4)
|
||||
onClicked: {
|
||||
selected = index
|
||||
child.color = Qt.binding(() => index == selected ? Pywal.colors.color13 : Pywal.colors.color4)
|
||||
}
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
ClippingRectangle {
|
||||
id: content
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
implicitWidth: parent.width - tabs.width - 2 * parent.spacing - rTabs.width - 2 * parent.spacing
|
||||
implicitHeight: parent.height
|
||||
radius: root.radius
|
||||
color: Pywal.colors.color1
|
||||
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
|
||||
readonly property Component launcher: LauncherButton {}
|
||||
|
||||
readonly property Component bt: Bluetooth {}
|
||||
readonly property Component vol: Volume {}
|
||||
|
||||
readonly property Component bat: PowerMode {}
|
||||
readonly property Component mon: LauncherButton {}
|
||||
|
||||
readonly property Component net: LauncherButton {}
|
||||
readonly property Component mus: LauncherButton {}
|
||||
|
||||
readonly property Component clk: Clock {}
|
||||
readonly property Component wal: LauncherButton {}
|
||||
|
||||
sourceComponent: switch(selected) {
|
||||
case 0:
|
||||
return wal;
|
||||
case 1:
|
||||
return mon;
|
||||
case 2:
|
||||
return net;
|
||||
case 3:
|
||||
return bt;
|
||||
case 4:
|
||||
return vol;
|
||||
case 5:
|
||||
case 6:
|
||||
return mus;
|
||||
case 7:
|
||||
return wal;
|
||||
case 8:
|
||||
return bat;
|
||||
default:
|
||||
return launcher;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: rTabs
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
Repeater {
|
||||
id: rRep
|
||||
|
||||
model: 9
|
||||
|
||||
WrapperMouseArea {
|
||||
ClippingRectangle {
|
||||
//Layout.alignment: Qt.AlignTop
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
radius: root.radius
|
||||
property bool use: false
|
||||
color: use ? Pywal.colors.color13 : Pywal.colors.color4
|
||||
//LauncherButton { anchors.centerIn: parent }
|
||||
Text {
|
||||
font.pointSize: 14
|
||||
text: switch(index) {
|
||||
case 0:
|
||||
return " ";
|
||||
case 1:
|
||||
return " ";
|
||||
case 2:
|
||||
return " ";
|
||||
case 3:
|
||||
return "";
|
||||
case 4:
|
||||
return " ";
|
||||
case 5:
|
||||
return " ";
|
||||
case 6:
|
||||
return " ";
|
||||
case 7:
|
||||
return " ";
|
||||
case 8:
|
||||
return " ";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
anchors.centerIn: parent
|
||||
color: Pywal.colors.color0
|
||||
}
|
||||
}
|
||||
onEntered: child.color = Qt.binding(() => child.use ? Pywal.colors.color13 : Pywal.colors.color12)
|
||||
onExited: child.color = Qt.binding(() => child.use ? Pywal.colors.color13 : Pywal.colors.color4)
|
||||
onClicked: {
|
||||
child.use = !child.use
|
||||
|
||||
switch(index) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
power.visible = true
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user