diff --git a/config/aurora-greeter/modules/Pywal.qml b/config/aurora-greeter/modules/Pywal.qml index 5fcf2c8..bc0d7db 100644 --- a/config/aurora-greeter/modules/Pywal.qml +++ b/config/aurora-greeter/modules/Pywal.qml @@ -7,11 +7,15 @@ Singleton { property string wallpaper: json.wallpaper - property string alpha: json.alpha + property string alpha: Math.round(parseInt(json.alpha, 10) * 0xFF / 100).toString(16) property JsonObject special: json.special property JsonObject colors: json.colors + function argb(c) { + return c.slice(0, 1) + Pywal.alpha + c.slice(1) + } + FileView { path: "/home/nathan/.cache/wal/colors.json" diff --git a/config/aurora/modules/Bar.qml b/config/aurora/modules/Bar.qml index 034f766..3c9739c 100644 --- a/config/aurora/modules/Bar.qml +++ b/config/aurora/modules/Bar.qml @@ -40,6 +40,12 @@ PanelWindow { Component.onCompleted: { root.hyprcmds.forEach((c) => { Hyprland.dispatch(c) }) + + Hyprland.rawEvent.connect((e) => { + if(e.name == "configreloaded") { + root.hyprcmds.forEach((c) => { Hyprland.dispatch(c) }) + } + }) } property int topEx: topRect.reserve diff --git a/config/aurora/modules/Battery.qml b/config/aurora/modules/Battery.qml index ff4478e..2863506 100644 --- a/config/aurora/modules/Battery.qml +++ b/config/aurora/modules/Battery.qml @@ -19,7 +19,7 @@ ClippingWrapperRectangle { Text { id: text - text: Math.round(UPower.displayDevice.percentage * 100) + "%" + text: (UPower.onBattery ? "" : "󱐋") + Math.round(UPower.displayDevice.percentage * 100) + "%" padding: 10 diff --git a/config/aurora/modules/Launcher.qml b/config/aurora/modules/Launcher.qml index 61cac69..a19383d 100644 --- a/config/aurora/modules/Launcher.qml +++ b/config/aurora/modules/Launcher.qml @@ -24,11 +24,12 @@ VFlyoutUp { id: content radius: root.radius implicitWidth: 700 - implicitHeight: 450 + implicitHeight: wallpaper.height color: Pywal.colors.color1 Wallpaper { + id: wallpaper implicitWidth: 700 //implicitHeight: 350 hyprcmds: midFO.hyprcmds diff --git a/config/aurora/modules/SettingsWindow.qml b/config/aurora/modules/SettingsWindow.qml index e69de29..4904e48 100644 --- a/config/aurora/modules/SettingsWindow.qml +++ b/config/aurora/modules/SettingsWindow.qml @@ -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 + } + } + } + + } + } + } + } +} diff --git a/config/aurora/modules/Wallpaper.qml b/config/aurora/modules/Wallpaper.qml index fd15e36..060be39 100644 --- a/config/aurora/modules/Wallpaper.qml +++ b/config/aurora/modules/Wallpaper.qml @@ -9,7 +9,7 @@ import Quickshell.Services.Pipewire -ScrollView { +Flickable { //anchors.fill: parent required property list hyprcmds @@ -18,7 +18,23 @@ ScrollView { property string dir: "/home/nathan/Pictures/Wallpaper/" - ScrollBar.horizontal.policy: ScrollBar.AlwaysOn + implicitHeight: lay.height + implicitWidth: 750 + interactive: true + + contentWidth: lay.width + + flickDeceleration: 5000 + + contentX: 100 + + WheelHandler { + target: root + //property: "contentX" + onWheel: { + console.log("test") + } + } Process { id: ls @@ -33,12 +49,16 @@ ScrollView { } RowLayout { + id: lay Repeater { id: rep model: 0 WrapperMouseArea { + onWheel: (e) => { + root.flick(e.angleDelta.y * 15, 0) + } ClippingWrapperRectangle { radius: 10 implicitWidth: 192 * 2; implicitHeight: 108 * 2