From dac2760b32cb4bbb01c9eaa7c8dc681eff4dca2a Mon Sep 17 00:00:00 2001 From: Hannes Date: Mon, 16 Feb 2026 16:37:56 +0100 Subject: [PATCH] Some slight updates to handling hovering buttons and added alpha of network --- modules/bar/Bar.qml | 4 +++- modules/bar/widgets/Network.qml | 26 ++++++++++++++++++++++++++ modules/bar/widgets/PowerButton.qml | 4 ++-- modules/bar/widgets/Workspaces.qml | 10 ++++++++++ 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 modules/bar/widgets/Network.qml diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 423ef2c..6946c77 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -39,8 +39,9 @@ PanelWindow { anchors.left: parent.left anchors.leftMargin: 16 spacing: 8 - + MenuButton {} + // TODO: Add functionallity (Maybe just rofi or own way) Workspaces { thisMonitor: barThisMonitor @@ -70,6 +71,7 @@ PanelWindow { spacing: 8 // TODO: Add bluetooth, network, audio, power, maybe HW monitor + // Network {} PowerButton {} } diff --git a/modules/bar/widgets/Network.qml b/modules/bar/widgets/Network.qml new file mode 100644 index 0000000..8ef0338 --- /dev/null +++ b/modules/bar/widgets/Network.qml @@ -0,0 +1,26 @@ +import QtQuick +import Quickshell +import Quickshell.Hyprland +// import Quickshell.Networking + +MouseArea { + id: networkButton + width: 30 + height: 28 + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + Rectangle { + anchors.fill: parent + color: networkButton.containsMouse ? "#2a2a2a" : "transparent" + radius: 6 + + Text { + anchors.centerIn: parent + text: "󰈀 " + font.pixelSize: 26 + font.family: "Nerd Font" + color: "#ffffff" + } + } +} \ No newline at end of file diff --git a/modules/bar/widgets/PowerButton.qml b/modules/bar/widgets/PowerButton.qml index a3a0ce1..d0630c0 100644 --- a/modules/bar/widgets/PowerButton.qml +++ b/modules/bar/widgets/PowerButton.qml @@ -4,7 +4,7 @@ import Quickshell.Hyprland import Quickshell.Io MouseArea { - id: archButton + id: powerButton width: 30 height: 28 hoverEnabled: true @@ -12,7 +12,7 @@ MouseArea { Rectangle { anchors.fill: parent - color: archButton.containsMouse ? "#2a2a2a" : "transparent" + color: powerButton.containsMouse ? "#2a2a2a" : "transparent" radius: 6 Item { diff --git a/modules/bar/widgets/Workspaces.qml b/modules/bar/widgets/Workspaces.qml index ebe3970..de5b468 100644 --- a/modules/bar/widgets/Workspaces.qml +++ b/modules/bar/widgets/Workspaces.qml @@ -22,10 +22,20 @@ Row { // Workspace Row border.width: 2 MouseArea { + id: workspaceButton hoverEnabled: true cursorShape: Qt.PointingHandCursor anchors.fill: parent onClicked: Hyprland.dispatch("workspace " + modelData.id) + + Rectangle { + anchors.fill: parent + color: workspaceButton.containsMouse ? + modelData.active ? "#7fbaff" + : "#808080" + : "transparent" + radius: 6 + } } Text {