fix merge
This commit is contained in:
commit
0d490310b8
@ -1,6 +1,7 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
import qs
|
import qs
|
||||||
import qs.settings
|
import qs.settings
|
||||||
|
|
||||||
@ -32,9 +33,9 @@ Variants {
|
|||||||
color: Qt.rgba(Colors.surface.r, Colors.surface.g, Colors.surface.b, Settings.config.translucency)
|
color: Qt.rgba(Colors.surface.r, Colors.surface.g, Colors.surface.b, Settings.config.translucency)
|
||||||
radius: Settings.config.floating ? Settings.config.barHeight / 2 : 0
|
radius: Settings.config.floating ? Settings.config.barHeight / 2 : 0
|
||||||
|
|
||||||
Row {
|
RowLayout {
|
||||||
id: leftStuff
|
id: leftStuff
|
||||||
leftPadding: Settings.config.barHeight / 4
|
anchors.margins: Settings.config.barHeight / 4
|
||||||
spacing: 10
|
spacing: 10
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@ -51,12 +52,14 @@ Variants {
|
|||||||
Clock {}
|
Clock {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
RowLayout {
|
||||||
id: rightStuff
|
id: rightStuff
|
||||||
rightPadding: Settings.config.barHeight / 4
|
anchors.margins: Settings.config.barHeight / 4
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
clip: true
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
Network {}
|
||||||
Volume {}
|
Volume {}
|
||||||
Battery {}
|
Battery {}
|
||||||
SysTray {}
|
SysTray {}
|
||||||
|
|||||||
@ -11,14 +11,13 @@ import qs.settings
|
|||||||
Loader {
|
Loader {
|
||||||
id: batLoader
|
id: batLoader
|
||||||
active: UPower.displayDevice.isLaptopBattery
|
active: UPower.displayDevice.isLaptopBattery
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
sourceComponent: Rectangle {
|
sourceComponent: Rectangle {
|
||||||
id: container
|
id: container
|
||||||
radius: implicitHeight / 2
|
radius: implicitHeight / 2
|
||||||
color: clickHandler.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
color: 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
|
||||||
@ -76,50 +75,12 @@ Loader {
|
|||||||
CustomText {
|
CustomText {
|
||||||
id: batText
|
id: batText
|
||||||
|
|
||||||
Layout.topMargin: 2
|
|
||||||
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
||||||
}
|
}
|
||||||
CustomIcon {
|
CustomIcon {
|
||||||
id: batIcon
|
id: batIcon
|
||||||
Layout.topMargin: 2
|
|
||||||
font.family: "Material Symbols Rounded"
|
|
||||||
text: root.getBatteryIcon()
|
text: root.getBatteryIcon()
|
||||||
}
|
}
|
||||||
Item {
|
|
||||||
implicitWidth: 12
|
|
||||||
implicitHeight: 12
|
|
||||||
|
|
||||||
IconImage {
|
|
||||||
id: rawProfileIcon
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Quickshell.iconPath(root.getProfileIcon())
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
|
|
||||||
ColorOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: rawProfileIcon
|
|
||||||
color: Colors.onSurfaceColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
id: clickHandler
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: mouse => {
|
|
||||||
const modes = [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance];
|
|
||||||
let current = PowerProfiles.profile;
|
|
||||||
let currentIndex = modes.indexOf(current);
|
|
||||||
let nextIndex = (currentIndex + 1) % modes.length;
|
|
||||||
let prevIndex = (currentIndex - 1) % modes.length;
|
|
||||||
if (mouse.button == Qt.LeftButton)
|
|
||||||
PowerProfiles.profile = modes[nextIndex];
|
|
||||||
if (mouse.button == Qt.RightButton)
|
|
||||||
PowerProfiles.profile = modes[prevIndex];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
88
modules/bar/Network.qml
Normal file
88
modules/bar/Network.qml
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
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:
|
||||||
|
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,7 +8,6 @@ Rectangle {
|
|||||||
id: root
|
id: root
|
||||||
radius: implicitHeight / 2
|
radius: implicitHeight / 2
|
||||||
color: pavuArea.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
color: pavuArea.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
implicitWidth: volumeIcon.implicitWidth + 10
|
implicitWidth: volumeIcon.implicitWidth + 10
|
||||||
implicitHeight: Settings.config.barHeight - 10
|
implicitHeight: Settings.config.barHeight - 10
|
||||||
CustomIcon {
|
CustomIcon {
|
||||||
|
|||||||
@ -8,7 +8,6 @@ Rectangle {
|
|||||||
id: container
|
id: container
|
||||||
radius: implicitHeight / 2
|
radius: implicitHeight / 2
|
||||||
color: Colors.surfaceContainer
|
color: Colors.surfaceContainer
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
implicitWidth: root.implicitWidth
|
implicitWidth: root.implicitWidth
|
||||||
implicitHeight: Settings.config.barHeight - 10
|
implicitHeight: Settings.config.barHeight - 10
|
||||||
Item {
|
Item {
|
||||||
|
|||||||
@ -10,9 +10,8 @@ Rectangle {
|
|||||||
id: root
|
id: root
|
||||||
radius: implicitHeight / 2
|
radius: implicitHeight / 2
|
||||||
color: pavuArea.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
color: pavuArea.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
implicitWidth: textRow.implicitWidth + 20
|
implicitWidth: textRow.implicitWidth + 20
|
||||||
implicitHeight: Settings.config.barHeight - 8
|
implicitHeight: Settings.config.barHeight - 10
|
||||||
property var sink: Pipewire.defaultAudioSink
|
property var sink: Pipewire.defaultAudioSink
|
||||||
function getVolumeIcon() {
|
function getVolumeIcon() {
|
||||||
// Safety check: if Pipewire is dead or sink is missing
|
// Safety check: if Pipewire is dead or sink is missing
|
||||||
@ -40,6 +39,7 @@ Rectangle {
|
|||||||
id: textRow
|
id: textRow
|
||||||
spacing: 2
|
spacing: 2
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
height: parent.height
|
||||||
CustomText {
|
CustomText {
|
||||||
id: volumeText
|
id: volumeText
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
@ -50,7 +50,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
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,9 +10,8 @@ Rectangle {
|
|||||||
color: Colors.surfaceContainer
|
color: Colors.surfaceContainer
|
||||||
|
|
||||||
implicitWidth: workspaceRow.implicitWidth + 10
|
implicitWidth: workspaceRow.implicitWidth + 10
|
||||||
implicitHeight: Settings.config.barHeight - 10
|
implicitHeight: Settings.config.barHeight - 10
|
||||||
radius: Settings.config.barHeight / 2
|
radius: Settings.config.barHeight / 2
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
property var screen: screen
|
property var screen: screen
|
||||||
Row {
|
Row {
|
||||||
id: workspaceRow
|
id: workspaceRow
|
||||||
|
|||||||
@ -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.startDetached();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,6 @@ Variants {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optional: Animate items moving up when one is dismissed
|
|
||||||
move: Transition {
|
move: Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
properties: "y"
|
properties: "y"
|
||||||
|
|||||||
@ -32,7 +32,7 @@ Rectangle {
|
|||||||
id: notiIcon
|
id: notiIcon
|
||||||
radius: notifyItem.radius - notifyItem.radius / 3
|
radius: notifyItem.radius - notifyItem.radius / 3
|
||||||
implicitWidth: 64
|
implicitWidth: 64
|
||||||
color: Colors.color8
|
color: "transparent"
|
||||||
implicitHeight: 64
|
implicitHeight: 64
|
||||||
visible: notifyItem.modelData.image !== ""
|
visible: notifyItem.modelData.image !== ""
|
||||||
IconImage {
|
IconImage {
|
||||||
|
|||||||
@ -278,38 +278,6 @@ 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 {
|
Item {
|
||||||
id: spring
|
id: spring
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|||||||
@ -23,7 +23,7 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
Process {
|
Process {
|
||||||
id: wallustRunner
|
id: wallustRunner
|
||||||
property string cmd: Settings.config.schemeGenerator === "matugen" ? "matugen image " + Settings.config.currentWall : "wallust run " + Settings.config.currentWall
|
property string cmd: "matugen image " + Settings.config.currentWall
|
||||||
command: ["sh", "-c", cmd]
|
command: ["sh", "-c", cmd]
|
||||||
}
|
}
|
||||||
GlobalShortcut {
|
GlobalShortcut {
|
||||||
|
|||||||
@ -1,10 +1,16 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import qs.settings
|
|
||||||
import qs
|
import qs
|
||||||
|
import qs.settings
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
verticalAlignment: Text.AlignVCenter
|
property real fill: 0
|
||||||
font.family: "Material Symbols Rounded"
|
font.family: "Material Symbols Rounded"
|
||||||
color: Colors.onSurfaceColor
|
color: Colors.onSurfaceColor
|
||||||
font.pixelSize: Settings.config.fontSize + 2
|
font.pixelSize: Settings.config.fontSize
|
||||||
|
font.variableAxes: ({
|
||||||
|
FILL: fill,
|
||||||
|
GRAD: 200,
|
||||||
|
opsz: 36,
|
||||||
|
wght: 400
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user