changes to network module and remove useless ipc commands

This commit is contained in:
lucy 2026-02-06 14:29:25 +01:00
parent e100bfa0e0
commit 9ab859b142
5 changed files with 32 additions and 44 deletions

View File

@ -17,7 +17,7 @@ Loader {
radius: implicitHeight / 2 radius: implicitHeight / 2
color: clickHandler.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer color: clickHandler.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
implicitWidth: root.implicitWidth + 20 implicitWidth: UPower.displayDevice.isLaptopBattery ? root.implicitWidth + 20 : 0
implicitHeight: Settings.config.barHeight - 10 implicitHeight: Settings.config.barHeight - 10
Item { Item {
id: root id: root

View File

@ -10,9 +10,10 @@ Rectangle {
id: root id: root
// This is the background of the entire bar/module // This is the background of the entire bar/module
// You might want to make this transparent if you only want the "pills" to show // You might want to make this transparent if you only want the "pills" to show
color: "transparent"
implicitHeight: Settings.config.barHeight - 10 implicitHeight: Settings.config.barHeight - 10
implicitWidth: mainLayout.implicitWidth implicitWidth: mainLayout.implicitWidth + 20
color: Colors.surfaceContainer
radius: implicitHeight / 2
// --- Logic Functions --- // --- Logic Functions ---
function getIcon(device) { function getIcon(device) {
@ -54,25 +55,16 @@ Rectangle {
// --- Main Layout --- // --- Main Layout ---
RowLayout { RowLayout {
id: mainLayout id: mainLayout
anchors.centerIn: parent
spacing: 10 // Space between multiple device pills (if you have ethernet + wifi) spacing: 10 // Space between multiple device pills (if you have ethernet + wifi)
Repeater { Repeater {
id: netRepeater id: netRepeater
model: Networking.devices model: Networking.devices
delegate: Rectangle { delegate: RowLayout {
id: devicePill
// Style settings for the "Pill"
color: Colors.surfaceContainer // Or use a specific grey: "#333333"
height: root.implicitHeight
radius: height / 2
// Calculate width: Content width + Padding (12px on each side)
width: innerContent.implicitWidth + 24
RowLayout {
id: innerContent id: innerContent
required property var modelData
// THIS fixes the centering issue: // THIS fixes the centering issue:
anchors.centerIn: parent anchors.centerIn: parent
spacing: 8 spacing: 8
@ -80,19 +72,18 @@ Rectangle {
CustomIcon { CustomIcon {
id: netIcon id: netIcon
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: root.getIcon(modelData) text: root.getIcon(innerContent.modelData)
} }
CustomText { CustomText {
id: netText id: netText
Layout.topMargin: 2 Layout.topMargin: 1
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: root.getStatus(modelData) text: root.getStatus(innerContent.modelData)
// Ensures the text font aligns vertically within its own line-height // Ensures the text font aligns vertically within its own line-height
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
} }
} }
} }
}
} }

View File

@ -37,12 +37,12 @@ Rectangle {
} }
RowLayout { RowLayout {
id: textRow id: textRow
spacing: 0 spacing: 2
anchors.centerIn: parent anchors.centerIn: parent
height: parent.height height: parent.height
CustomText { CustomText {
id: volumeText id: volumeText
Layout.alignment: Qt.AlignVCenter Layout.topMargin: 1
PwObjectTracker { PwObjectTracker {
objects: Pipewire.ready ? Pipewire.defaultAudioSink : [] objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
} }
@ -51,7 +51,6 @@ Rectangle {
} }
CustomIcon { CustomIcon {
id: volumeIcon id: volumeIcon
Layout.alignment: Qt.AlignVCenter
opacity: Pipewire.ready ? root.sink.audio.muted ? 0.5 : 1 : 0 opacity: Pipewire.ready ? root.sink.audio.muted ? 0.5 : 1 : 0
text: Pipewire.ready ? root.getVolumeIcon() : null text: Pipewire.ready ? root.getVolumeIcon() : null
} }

View File

@ -2,6 +2,7 @@ import QtQuick
import Quickshell.Io import Quickshell.Io
import qs.settings import qs.settings
import QtQuick.Dialogs import QtQuick.Dialogs
import Quickshell
Item { Item {
FontDialog { FontDialog {
@ -12,18 +13,15 @@ Item {
IpcHandler { IpcHandler {
id: ipcHandler id: ipcHandler
target: "settings" 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 { function setFont(newFont: string): void {
Settings.config.font = newFont; Settings.config.font = newFont;
} }
function gen(toggle: bool): void { function gen(toggle: bool): void {
Settings.config.generateScheme = toggle; Settings.config.generateScheme = toggle;
} }
function reload(hard: bool): void {
Quickshell.reload(hard);
console.log("reloaded!");
}
} }
} }

View File

@ -9,8 +9,8 @@ Text {
font.pixelSize: Settings.config.fontSize font.pixelSize: Settings.config.fontSize
font.variableAxes: ({ font.variableAxes: ({
FILL: fill, FILL: fill,
GRAD: 0, GRAD: 200,
opsz: 24, opsz: 36,
wght: 400 wght: 400
}) })
} }