revert dwm styling, just use dwm instead

This commit is contained in:
lucy 2026-06-09 11:36:43 +02:00
commit 1d96e74bb6
5 changed files with 95 additions and 108 deletions

View file

@ -18,26 +18,20 @@ Rectangle {
implicitHeight: moduleHeight
implicitWidth: batLayout.implicitWidth + 16
radius: Config.rounding
function batteryIcon(percent, charging) {
if (percent <= 15)
return charging ? "battery_charging_20" : "battery_alert";
if (percent <= 30)
return charging ? "battery_charging_30" : "battery_2_bar";
if (percent <= 50)
return charging ? "battery_charging_50" : "battery_3_bar";
if (percent <= 70)
return charging ? "battery_charging_60" : "battery_4_bar";
if (percent <= 85)
return charging ? "battery_charging_80" : "battery_5_bar";
if (percent <= 95)
return charging ? "battery_charging_90" : "battery_6_bar";
return charging ? "battery_charging_full" : "battery_full";
function batteryIcon() {
if (root.charging) { return "\uea33"; }
else if(root.percent <= 20) { return "\uea34" }
else if(root.percent <= 40) { return "\uea2f" }
else if(root.percent <= 60) { return "\uea30" }
else if(root.percent <= 80) { return "\uea31" }
else if(root.percent >= 80) { return "\uea32" }
}
RowLayout {
id: batLayout
anchors.centerIn: root
MaterialIcon {
text: root.batteryIcon(root.percent, root.charging)
text: root.batteryIcon()
}
StyledText {
text: Math.floor(root.percent) + "%"

View file

@ -26,7 +26,7 @@ Rectangle {
id: songLayout
anchors.centerIn: root
MaterialIcon {
text: "music_note_2"
text: "\ueafc"
}
StyledText {
Layout.maximumWidth: 400

View file

@ -18,18 +18,19 @@ Rectangle {
function getVolumeIcon() {
let volume = Pipewire.ready ? root.defaultAudio.audio.volume : null;
if (root.mute) {
return "\ue04f";
return "\uf1c3";
}
if (volume <= 0.33) {
return "\ue04e";
return "\u1019d";
}
if (volume <= 0.66) {
return "\ue04d";
return "\ueb4f";
}
if (volume >= 0.66) {
return "\ue050";
return "\ueb51";
}
}
PwObjectTracker {
objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null]
}

View file

@ -7,86 +7,86 @@ import qs.settings
import qs.widgets
WrapperRectangle {
id: root
required property var notification
required property ShellScreen nScreen
implicitWidth: nScreen.width / 6
implicitHeight: 100
radius: Config.rounding
anchors.right: parent?.right
color: Colors.base01
clip: true
Timer {
id: dismissTimer
running: true
interval: 5000
repeat: false
onTriggered: root.notification?.dismiss()
id: root
required property var notification
required property ShellScreen nScreen
implicitWidth: nScreen.width / 6
implicitHeight: 100
radius: Config.rounding
anchors.right: parent?.right
color: Colors.base01
clip: true
Timer {
id: dismissTimer
running: true
interval: 5000
repeat: false
onTriggered: root.notification?.dismiss()
}
child: WrapperMouseArea {
id: mouseHandler
child: RowLayout {
spacing: 10
IconImage {
id: appIcon
Layout.leftMargin: 8
visible: root.notification?.image ? true : false
source: root.notification?.image ? root.notification.image : ''
implicitSize: 64
}
ColumnLayout {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
Layout.preferredWidth: 0
Layout.fillHeight: true
Layout.leftMargin: appIcon.visible ? 0 : 16
RowLayout {
Layout.alignment: Qt.AlignTop
MaterialIcon {
text: "\uea35"
font.pixelSize: 12
}
StyledText {
id: appId
text: root.notification?.appName ? root.notification.appName : ''
opacity: 0.4
}
}
ColumnLayout {
spacing: 0
Layout.rightMargin: 40
StyledText {
id: title
Layout.bottomMargin: 0
Layout.topMargin: 5
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
text: root.notification?.summary == null ? '' : root.notification.summary
elide: Text.ElideRight
}
StyledText {
id: body
Layout.alignment: Qt.AlignBottom
text: root.notification?.body ? root.notification.body : ''
elide: Text.ElideRight
maximumLineCount: 1
Layout.fillWidth: true
opacity: 0.6
}
}
}
}
child: WrapperMouseArea {
id: mouseHandler
child: RowLayout {
spacing: 10
IconImage {
id: appIcon
Layout.leftMargin: 8
visible: root.notification?.image ? true : false
source: root.notification?.image ? root.notification.image : ''
implicitSize: 64
}
ColumnLayout {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
Layout.preferredWidth: 0
Layout.fillHeight: true
Layout.leftMargin: appIcon.visible ? 0 : 16
RowLayout {
Layout.alignment: Qt.AlignTop
MaterialIcon {
text: "\ue7f4"
font.pixelSize: 12
}
StyledText {
id: appId
text: root.notification?.appName ? root.notification.appName : ''
opacity: 0.4
}
}
ColumnLayout {
spacing: 0
Layout.rightMargin: 40
StyledText {
id: title
Layout.bottomMargin: 0
Layout.topMargin: 5
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
text: root.notification?.summary == null ? '' : root.notification.summary
elide: Text.ElideRight
}
StyledText {
id: body
Layout.alignment: Qt.AlignBottom
text: root.notification?.body ? root.notification.body : ''
elide: Text.ElideRight
maximumLineCount: 1
Layout.fillWidth: true
opacity: 0.6
}
}
}
}
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onEntered: {
root.color = Colors.base03;
}
onExited: {
root.color = Colors.base01;
}
onClicked: {
root.notification ? root.notification.dismiss() : '';
}
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onEntered: {
root.color = Colors.base03;
}
onExited: {
root.color = Colors.base01;
}
onClicked: {
root.notification ? root.notification.dismiss() : '';
}
}
}