Compare commits
No commits in common. "318ca10e44dc776503e13a19c97aa3827a1e90bd" and "45aed4fab3d1770dede54bdf2dc6672e06b224fe" have entirely different histories.
318ca10e44
...
45aed4fab3
@ -1,7 +1,6 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
import qs.settings
|
||||
|
||||
@ -33,9 +32,9 @@ Variants {
|
||||
color: Qt.rgba(Colors.surface.r, Colors.surface.g, Colors.surface.b, Settings.config.translucency)
|
||||
radius: Settings.config.floating ? Settings.config.barHeight / 2 : 0
|
||||
|
||||
RowLayout {
|
||||
Row {
|
||||
id: leftStuff
|
||||
anchors.margins: Settings.config.barHeight / 4
|
||||
leftPadding: Settings.config.barHeight / 4
|
||||
spacing: 10
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@ -52,14 +51,12 @@ Variants {
|
||||
Clock {}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Row {
|
||||
id: rightStuff
|
||||
anchors.margins: Settings.config.barHeight / 4
|
||||
rightPadding: Settings.config.barHeight / 4
|
||||
spacing: 10
|
||||
clip: true
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
Network {}
|
||||
Volume {}
|
||||
Battery {}
|
||||
SysTray {}
|
||||
|
||||
@ -11,13 +11,14 @@ import qs.settings
|
||||
Loader {
|
||||
id: batLoader
|
||||
active: UPower.displayDevice.isLaptopBattery
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
sourceComponent: Rectangle {
|
||||
id: container
|
||||
radius: implicitHeight / 2
|
||||
color: clickHandler.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitWidth: UPower.displayDevice.isLaptopBattery ? root.implicitWidth + 20 : 0
|
||||
implicitWidth: root.implicitWidth + 20
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
Item {
|
||||
id: root
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import Quickshell.Networking
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.reusables
|
||||
import qs.settings
|
||||
import qs
|
||||
|
||||
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
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
implicitWidth: mainLayout.implicitWidth + 20
|
||||
color: Colors.surfaceContainer
|
||||
radius: implicitHeight / 2
|
||||
|
||||
// --- Logic Functions ---
|
||||
function getIcon(device) {
|
||||
if (device.type === DeviceType.Wifi) {
|
||||
for (var i = 0; i < device.networks.values.length; i++) {
|
||||
var net = device.networks.values[i];
|
||||
if (net.connected) {
|
||||
if (net.signalStrength <= 0.20)
|
||||
return "android_wifi_0_bar";
|
||||
if (net.signalStrength <= 0.40)
|
||||
return "android_wifi_1_bar";
|
||||
if (net.signalStrength <= 0.60)
|
||||
return "android_wifi_2_bar";
|
||||
if (net.signalStrength <= 0.80)
|
||||
return "android_wifi_3_bar";
|
||||
return "android_wifi_4_bar";
|
||||
}
|
||||
}
|
||||
return "wifi_off";
|
||||
} else if (device.connected) {
|
||||
return "settings_ethernet";
|
||||
}
|
||||
return "wifi_off";
|
||||
}
|
||||
|
||||
function getStatus(device) {
|
||||
if (device.type === DeviceType.Wifi) {
|
||||
for (var i = 0; i < device.networks.values.length; i++) {
|
||||
var net = device.networks.values[i];
|
||||
if (net.connected) {
|
||||
return net.name;
|
||||
}
|
||||
}
|
||||
return "Disconnected";
|
||||
}
|
||||
return device.connected ? "Connected" : "Disconnected";
|
||||
}
|
||||
|
||||
// --- 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: RowLayout {
|
||||
id: innerContent
|
||||
required property var modelData
|
||||
// THIS fixes the centering issue:
|
||||
anchors.centerIn: parent
|
||||
spacing: 8
|
||||
|
||||
CustomIcon {
|
||||
id: netIcon
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: root.getIcon(innerContent.modelData)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,7 @@ Rectangle {
|
||||
id: root
|
||||
radius: implicitHeight / 2
|
||||
color: pavuArea.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitWidth: volumeIcon.implicitWidth + 10
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
CustomIcon {
|
||||
|
||||
@ -8,6 +8,7 @@ Rectangle {
|
||||
id: container
|
||||
radius: implicitHeight / 2
|
||||
color: Colors.surfaceContainer
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitWidth: root.implicitWidth
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
Item {
|
||||
|
||||
@ -10,8 +10,9 @@ Rectangle {
|
||||
id: root
|
||||
radius: implicitHeight / 2
|
||||
color: pavuArea.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitWidth: textRow.implicitWidth + 20
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
implicitHeight: Settings.config.barHeight - 8
|
||||
property var sink: Pipewire.defaultAudioSink
|
||||
function getVolumeIcon() {
|
||||
// Safety check: if Pipewire is dead or sink is missing
|
||||
@ -39,10 +40,8 @@ Rectangle {
|
||||
id: textRow
|
||||
spacing: 2
|
||||
anchors.centerIn: parent
|
||||
height: parent.height
|
||||
CustomText {
|
||||
id: volumeText
|
||||
Layout.topMargin: 1
|
||||
PwObjectTracker {
|
||||
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
|
||||
}
|
||||
@ -51,6 +50,7 @@ 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
|
||||
}
|
||||
|
||||
@ -10,8 +10,9 @@ Rectangle {
|
||||
color: Colors.surfaceContainer
|
||||
|
||||
implicitWidth: workspaceRow.implicitWidth + 10
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
radius: Settings.config.barHeight / 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
property var screen: screen
|
||||
Row {
|
||||
id: workspaceRow
|
||||
|
||||
@ -2,7 +2,6 @@ import QtQuick
|
||||
import Quickshell.Io
|
||||
import qs.settings
|
||||
import QtQuick.Dialogs
|
||||
import Quickshell
|
||||
|
||||
Item {
|
||||
FontDialog {
|
||||
@ -13,15 +12,18 @@ 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.startDetached();
|
||||
}
|
||||
}
|
||||
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!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ Rectangle {
|
||||
required property var modelData
|
||||
implicitWidth: ListView.view ? ListView.view.width : 300
|
||||
implicitHeight: fullLayout.implicitHeight + 20
|
||||
color: dismissArea.containsMouse ? Colors.surfaceContainerLow : Colors.surfaceContainerHigh
|
||||
color: dismissArea.containsMouse ? Colors.color5 : Colors.color6
|
||||
radius: 22
|
||||
Timer {
|
||||
id: dismissTimer
|
||||
@ -32,7 +32,7 @@ Rectangle {
|
||||
id: notiIcon
|
||||
radius: notifyItem.radius - notifyItem.radius / 3
|
||||
implicitWidth: 64
|
||||
color: "transparent"
|
||||
color: Colors.color8
|
||||
implicitHeight: 64
|
||||
visible: notifyItem.modelData.image !== ""
|
||||
IconImage {
|
||||
|
||||
@ -278,6 +278,38 @@ ClippingWrapperRectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
ClippingWrapperRectangle {
|
||||
id: schemeGeneratorWrapper
|
||||
Layout.fillWidth: true
|
||||
leftMargin: 10
|
||||
rightMargin: 15
|
||||
implicitHeight: 30
|
||||
bottomLeftRadius: 12
|
||||
bottomRightRadius: 12
|
||||
topRightRadius: 4
|
||||
topLeftRadius: 4
|
||||
color: Colors.surfaceContainerHigh
|
||||
child: RowLayout {
|
||||
id: schemeGeneratorLayout
|
||||
spacing: 5
|
||||
CustomText {
|
||||
id: schemeGeneratorText
|
||||
text: "Scheme generator"
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
CustomButton {
|
||||
implicitHeight: schemeGeneratorWrapper.implicitHeight - 10
|
||||
onClicked: {
|
||||
if (Settings.config.schemeGenerator === "matugen") {
|
||||
Settings.config.schemeGenerator = "wallust";
|
||||
} else {
|
||||
Settings.config.schemeGenerator = "matugen";
|
||||
}
|
||||
}
|
||||
customText: Settings.config.schemeGenerator
|
||||
}
|
||||
}
|
||||
}
|
||||
Item {
|
||||
id: spring
|
||||
Layout.fillHeight: true
|
||||
|
||||
@ -23,7 +23,7 @@ FloatingWindow {
|
||||
}
|
||||
Process {
|
||||
id: wallustRunner
|
||||
property string cmd: "matugen image " + Settings.config.currentWall
|
||||
property string cmd: Settings.config.schemeGenerator === "matugen" ? "matugen image " + Settings.config.currentWall : "wallust run " + Settings.config.currentWall
|
||||
command: ["sh", "-c", cmd]
|
||||
}
|
||||
GlobalShortcut {
|
||||
|
||||
@ -1,16 +1,10 @@
|
||||
import QtQuick
|
||||
import qs
|
||||
import qs.settings
|
||||
import qs
|
||||
|
||||
Text {
|
||||
property real fill: 0
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.family: "Material Symbols Rounded"
|
||||
color: Colors.onSurfaceColor
|
||||
font.pixelSize: Settings.config.fontSize
|
||||
font.variableAxes: ({
|
||||
FILL: fill,
|
||||
GRAD: 200,
|
||||
opsz: 36,
|
||||
wght: 400
|
||||
})
|
||||
font.pixelSize: Settings.config.fontSize + 2
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user