From 62f7a986e8dda74d1e9248f4fb59179b2f679fc0 Mon Sep 17 00:00:00 2001 From: lucy Date: Fri, 6 Feb 2026 20:16:22 +0100 Subject: [PATCH] remove margin in volume and bat --- modules/bar/Battery.qml | 40 +------------------------------------- modules/bar/Brightness.qml | 10 ++++++++++ modules/bar/Network.qml | 1 - modules/bar/Volume.qml | 1 - 4 files changed, 11 insertions(+), 41 deletions(-) create mode 100644 modules/bar/Brightness.qml diff --git a/modules/bar/Battery.qml b/modules/bar/Battery.qml index 7663ad0..ce8adf7 100644 --- a/modules/bar/Battery.qml +++ b/modules/bar/Battery.qml @@ -15,7 +15,7 @@ Loader { sourceComponent: Rectangle { id: container radius: implicitHeight / 2 - color: clickHandler.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer + color: Colors.surfaceContainer anchors.verticalCenter: parent.verticalCenter implicitWidth: UPower.displayDevice.isLaptopBattery ? root.implicitWidth + 20 : 0 implicitHeight: Settings.config.barHeight - 10 @@ -75,50 +75,12 @@ Loader { CustomText { id: batText - Layout.topMargin: 2 text: Math.round(UPower.displayDevice.percentage * 100) + "%" } CustomIcon { id: batIcon - Layout.topMargin: 2 - font.family: "Material Symbols Rounded" text: root.getBatteryIcon() } - Item { - implicitWidth: 12 - implicitHeight: 12 - - IconImage { - id: rawProfileIcon - anchors.fill: parent - source: Quickshell.iconPath(root.getProfileIcon()) - visible: false - } - - ColorOverlay { - anchors.fill: parent - source: rawProfileIcon - color: Colors.onSurfaceColor - } - } - } - MouseArea { - id: clickHandler - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - acceptedButtons: Qt.LeftButton | Qt.RightButton - hoverEnabled: true - onClicked: mouse => { - const modes = [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance]; - let current = PowerProfiles.profile; - let currentIndex = modes.indexOf(current); - let nextIndex = (currentIndex + 1) % modes.length; - let prevIndex = (currentIndex - 1) % modes.length; - if (mouse.button == Qt.LeftButton) - PowerProfiles.profile = modes[nextIndex]; - if (mouse.button == Qt.RightButton) - PowerProfiles.profile = modes[prevIndex]; - } } } } diff --git a/modules/bar/Brightness.qml b/modules/bar/Brightness.qml new file mode 100644 index 0000000..a371860 --- /dev/null +++ b/modules/bar/Brightness.qml @@ -0,0 +1,10 @@ +import Quickshell +import QtQuick +import Quickshell.Io +import qs +import qs.settings + +Rectangle { + id: root + implicitHeight: Settings.config.barHeight +} diff --git a/modules/bar/Network.qml b/modules/bar/Network.qml index bbb78d0..3df2c4a 100644 --- a/modules/bar/Network.qml +++ b/modules/bar/Network.qml @@ -66,7 +66,6 @@ Rectangle { id: innerContent required property var modelData // THIS fixes the centering issue: - anchors.centerIn: parent spacing: 8 CustomIcon { diff --git a/modules/bar/Volume.qml b/modules/bar/Volume.qml index 8257796..3237cee 100644 --- a/modules/bar/Volume.qml +++ b/modules/bar/Volume.qml @@ -42,7 +42,6 @@ Rectangle { height: parent.height CustomText { id: volumeText - Layout.topMargin: 1 PwObjectTracker { objects: Pipewire.ready ? Pipewire.defaultAudioSink : [] }