From 9ab859b1423a55dc11f2ea1efefbc715efbf290a Mon Sep 17 00:00:00 2001 From: lucy Date: Fri, 6 Feb 2026 14:29:25 +0100 Subject: [PATCH] changes to network module and remove useless ipc commands --- modules/bar/Battery.qml | 2 +- modules/bar/Network.qml | 53 +++++++++++++++++----------------------- modules/bar/Volume.qml | 5 ++-- modules/ipc/Ipc.qml | 12 ++++----- reusables/CustomIcon.qml | 4 +-- 5 files changed, 32 insertions(+), 44 deletions(-) diff --git a/modules/bar/Battery.qml b/modules/bar/Battery.qml index 05adbf4..7663ad0 100644 --- a/modules/bar/Battery.qml +++ b/modules/bar/Battery.qml @@ -17,7 +17,7 @@ Loader { radius: implicitHeight / 2 color: clickHandler.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer anchors.verticalCenter: parent.verticalCenter - implicitWidth: root.implicitWidth + 20 + implicitWidth: UPower.displayDevice.isLaptopBattery ? root.implicitWidth + 20 : 0 implicitHeight: Settings.config.barHeight - 10 Item { id: root diff --git a/modules/bar/Network.qml b/modules/bar/Network.qml index aca94f9..bbb78d0 100644 --- a/modules/bar/Network.qml +++ b/modules/bar/Network.qml @@ -10,9 +10,10 @@ Rectangle { id: root // This is the background of the entire bar/module // You might want to make this transparent if you only want the "pills" to show - color: "transparent" implicitHeight: Settings.config.barHeight - 10 - implicitWidth: mainLayout.implicitWidth + implicitWidth: mainLayout.implicitWidth + 20 + color: Colors.surfaceContainer + radius: implicitHeight / 2 // --- Logic Functions --- function getIcon(device) { @@ -54,43 +55,33 @@ Rectangle { // --- Main Layout --- RowLayout { id: mainLayout + anchors.centerIn: parent spacing: 10 // Space between multiple device pills (if you have ethernet + wifi) Repeater { id: netRepeater model: Networking.devices - delegate: Rectangle { - id: devicePill + delegate: RowLayout { + id: innerContent + required property var modelData + // THIS fixes the centering issue: + anchors.centerIn: parent + spacing: 8 - // Style settings for the "Pill" - color: Colors.surfaceContainer // Or use a specific grey: "#333333" - height: root.implicitHeight - radius: height / 2 + CustomIcon { + id: netIcon + Layout.alignment: Qt.AlignVCenter + text: root.getIcon(innerContent.modelData) + } - // Calculate width: Content width + Padding (12px on each side) - width: innerContent.implicitWidth + 24 - - RowLayout { - id: innerContent - // THIS fixes the centering issue: - anchors.centerIn: parent - spacing: 8 - - CustomIcon { - id: netIcon - Layout.alignment: Qt.AlignVCenter - text: root.getIcon(modelData) - } - - CustomText { - id: netText - Layout.topMargin: 2 - Layout.alignment: Qt.AlignVCenter - text: root.getStatus(modelData) - // Ensures the text font aligns vertically within its own line-height - verticalAlignment: Text.AlignVCenter - } + CustomText { + id: netText + Layout.topMargin: 1 + Layout.alignment: Qt.AlignVCenter + text: root.getStatus(innerContent.modelData) + // Ensures the text font aligns vertically within its own line-height + verticalAlignment: Text.AlignVCenter } } } diff --git a/modules/bar/Volume.qml b/modules/bar/Volume.qml index a0e2322..8257796 100644 --- a/modules/bar/Volume.qml +++ b/modules/bar/Volume.qml @@ -37,12 +37,12 @@ Rectangle { } RowLayout { id: textRow - spacing: 0 + spacing: 2 anchors.centerIn: parent height: parent.height CustomText { id: volumeText - Layout.alignment: Qt.AlignVCenter + Layout.topMargin: 1 PwObjectTracker { objects: Pipewire.ready ? Pipewire.defaultAudioSink : [] } @@ -51,7 +51,6 @@ Rectangle { } CustomIcon { id: volumeIcon - Layout.alignment: Qt.AlignVCenter opacity: Pipewire.ready ? root.sink.audio.muted ? 0.5 : 1 : 0 text: Pipewire.ready ? root.getVolumeIcon() : null } diff --git a/modules/ipc/Ipc.qml b/modules/ipc/Ipc.qml index cd2f116..0d91445 100644 --- a/modules/ipc/Ipc.qml +++ b/modules/ipc/Ipc.qml @@ -2,6 +2,7 @@ import QtQuick import Quickshell.Io import qs.settings import QtQuick.Dialogs +import Quickshell Item { FontDialog { @@ -12,18 +13,15 @@ Item { IpcHandler { id: ipcHandler target: "settings" - function setWall(newWall: string): void { - console.log(Settings.config.generateScheme); - Settings.config.currentWall = newWall; - if (Settings.config.generateScheme === true) { - wallustRunner.running = true; - } - } function setFont(newFont: string): void { Settings.config.font = newFont; } function gen(toggle: bool): void { Settings.config.generateScheme = toggle; } + function reload(hard: bool): void { + Quickshell.reload(hard); + console.log("reloaded!"); + } } } diff --git a/reusables/CustomIcon.qml b/reusables/CustomIcon.qml index 98084a0..6647e7d 100644 --- a/reusables/CustomIcon.qml +++ b/reusables/CustomIcon.qml @@ -9,8 +9,8 @@ Text { font.pixelSize: Settings.config.fontSize font.variableAxes: ({ FILL: fill, - GRAD: 0, - opsz: 24, + GRAD: 200, + opsz: 36, wght: 400 }) }