revert dwm styling, just use dwm instead
This commit is contained in:
parent
e016783036
commit
1d96e74bb6
5 changed files with 95 additions and 108 deletions
|
|
@ -18,26 +18,20 @@ Rectangle {
|
||||||
implicitHeight: moduleHeight
|
implicitHeight: moduleHeight
|
||||||
implicitWidth: batLayout.implicitWidth + 16
|
implicitWidth: batLayout.implicitWidth + 16
|
||||||
radius: Config.rounding
|
radius: Config.rounding
|
||||||
function batteryIcon(percent, charging) {
|
function batteryIcon() {
|
||||||
if (percent <= 15)
|
if (root.charging) { return "\uea33"; }
|
||||||
return charging ? "battery_charging_20" : "battery_alert";
|
else if(root.percent <= 20) { return "\uea34" }
|
||||||
if (percent <= 30)
|
else if(root.percent <= 40) { return "\uea2f" }
|
||||||
return charging ? "battery_charging_30" : "battery_2_bar";
|
else if(root.percent <= 60) { return "\uea30" }
|
||||||
if (percent <= 50)
|
else if(root.percent <= 80) { return "\uea31" }
|
||||||
return charging ? "battery_charging_50" : "battery_3_bar";
|
else if(root.percent >= 80) { return "\uea32" }
|
||||||
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";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: batLayout
|
id: batLayout
|
||||||
anchors.centerIn: root
|
anchors.centerIn: root
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
text: root.batteryIcon(root.percent, root.charging)
|
text: root.batteryIcon()
|
||||||
}
|
}
|
||||||
StyledText {
|
StyledText {
|
||||||
text: Math.floor(root.percent) + "%"
|
text: Math.floor(root.percent) + "%"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ Rectangle {
|
||||||
id: songLayout
|
id: songLayout
|
||||||
anchors.centerIn: root
|
anchors.centerIn: root
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
text: "music_note_2"
|
text: "\ueafc"
|
||||||
}
|
}
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.maximumWidth: 400
|
Layout.maximumWidth: 400
|
||||||
|
|
|
||||||
|
|
@ -18,18 +18,19 @@ Rectangle {
|
||||||
function getVolumeIcon() {
|
function getVolumeIcon() {
|
||||||
let volume = Pipewire.ready ? root.defaultAudio.audio.volume : null;
|
let volume = Pipewire.ready ? root.defaultAudio.audio.volume : null;
|
||||||
if (root.mute) {
|
if (root.mute) {
|
||||||
return "\ue04f";
|
return "\uf1c3";
|
||||||
}
|
}
|
||||||
if (volume <= 0.33) {
|
if (volume <= 0.33) {
|
||||||
return "\ue04e";
|
return "\u1019d";
|
||||||
}
|
}
|
||||||
if (volume <= 0.66) {
|
if (volume <= 0.66) {
|
||||||
return "\ue04d";
|
return "\ueb4f";
|
||||||
}
|
}
|
||||||
if (volume >= 0.66) {
|
if (volume >= 0.66) {
|
||||||
return "\ue050";
|
return "\ueb51";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null]
|
objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,86 +7,86 @@ import qs.settings
|
||||||
import qs.widgets
|
import qs.widgets
|
||||||
|
|
||||||
WrapperRectangle {
|
WrapperRectangle {
|
||||||
id: root
|
id: root
|
||||||
required property var notification
|
required property var notification
|
||||||
required property ShellScreen nScreen
|
required property ShellScreen nScreen
|
||||||
implicitWidth: nScreen.width / 6
|
implicitWidth: nScreen.width / 6
|
||||||
implicitHeight: 100
|
implicitHeight: 100
|
||||||
radius: Config.rounding
|
radius: Config.rounding
|
||||||
anchors.right: parent?.right
|
anchors.right: parent?.right
|
||||||
color: Colors.base01
|
color: Colors.base01
|
||||||
clip: true
|
clip: true
|
||||||
Timer {
|
Timer {
|
||||||
id: dismissTimer
|
id: dismissTimer
|
||||||
running: true
|
running: true
|
||||||
interval: 5000
|
interval: 5000
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: root.notification?.dismiss()
|
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 {
|
acceptedButtons: Qt.LeftButton
|
||||||
id: mouseHandler
|
cursorShape: Qt.PointingHandCursor
|
||||||
child: RowLayout {
|
hoverEnabled: true
|
||||||
spacing: 10
|
onEntered: {
|
||||||
IconImage {
|
root.color = Colors.base03;
|
||||||
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() : '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
onExited: {
|
||||||
|
root.color = Colors.base01;
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
root.notification ? root.notification.dismiss() : '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,7 @@ import qs.settings
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
font.family: "Material Symbols Rounded"
|
font.family: "tabler-icons"
|
||||||
color: Colors.base07
|
color: Colors.base07
|
||||||
font.pixelSize: Config.iconSize
|
font.pixelSize: Config.iconSize
|
||||||
property bool fill: false
|
|
||||||
renderType: Text.NativeRendering
|
|
||||||
font.variableAxes: {
|
|
||||||
"FILL": fill ? 1 : 0,
|
|
||||||
"opsz": 24,
|
|
||||||
"wght": 400,
|
|
||||||
"GRAD": 24
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue