origin/new #2

Merged
lucy merged 7 commits from origin/new into new 2026-02-06 19:16:59 +01:00
5 changed files with 32 additions and 44 deletions
Showing only changes of commit 9ab859b142 - Show all commits

View File

@ -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

View File

@ -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,19 +72,18 @@ 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
}
}
}
}
}
}

View File

@ -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
}

View File

@ -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!");
}
}
}

View File

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