changes to network module and remove useless ipc commands
This commit is contained in:
parent
e100bfa0e0
commit
9ab859b142
@ -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
|
||||
|
||||
@ -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,25 +55,16 @@ 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
|
||||
|
||||
// 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 {
|
||||
delegate: RowLayout {
|
||||
id: innerContent
|
||||
required property var modelData
|
||||
// THIS fixes the centering issue:
|
||||
anchors.centerIn: parent
|
||||
spacing: 8
|
||||
@ -80,14 +72,14 @@ Rectangle {
|
||||
CustomIcon {
|
||||
id: netIcon
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: root.getIcon(modelData)
|
||||
text: root.getIcon(innerContent.modelData)
|
||||
}
|
||||
|
||||
CustomText {
|
||||
id: netText
|
||||
Layout.topMargin: 2
|
||||
Layout.topMargin: 1
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: root.getStatus(modelData)
|
||||
text: root.getStatus(innerContent.modelData)
|
||||
// Ensures the text font aligns vertically within its own line-height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
@ -95,4 +87,3 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,8 +9,8 @@ Text {
|
||||
font.pixelSize: Settings.config.fontSize
|
||||
font.variableAxes: ({
|
||||
FILL: fill,
|
||||
GRAD: 0,
|
||||
opsz: 24,
|
||||
GRAD: 200,
|
||||
opsz: 36,
|
||||
wght: 400
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user