This commit is contained in:
2026-08-21 04:43:52 +03:30
parent af2189a587
commit 9b6b4958ff
9 changed files with 142 additions and 85 deletions
@@ -2,6 +2,7 @@ spawn-at-startup "waybar"
spawn-at-startup "awww-daemon"
spawn-at-startup "awww" "img" "/home/coast/Wallpapers/nature2art.png"
spawn-sh-at-startup "XDG_DATA_DIRS=/etc/profiles/per-user/coast/share:/run/current-system/sw/share:$HOME/.nix-profile/share:$XDG_DATA_DIRS"
spawn-at-startup "qs"
input {
mod-key "Super"
@@ -1,6 +1,6 @@
const colors = {
bg: "#1a1b26",
bgDark: "#16161a",
bg: "#121212",
bgDark: "#121212",
fg: "#cdd6f4",
muted: "#444b6a",
cyan: "#d3869b",
+84 -39
View File
@@ -22,7 +22,7 @@ Scope {
PanelWindow {
anchors { top: true; right: true }
margins { top: 56; right: 12 }
margins { top: 12; right: 12 }
implicitWidth: 380
implicitHeight: Math.max(1, column.implicitHeight)
@@ -41,19 +41,24 @@ Scope {
id: card
required property var modelData
Layout.fillWidth: true
implicitHeight: cardLayout.implicitHeight + 20
radius: 12
color: Config.colors.bgDark
border.color: hoverArea.containsMouse ? Config.colors.purple : "transparent"
border.width: 1
Behavior on border.color { ColorAnimation { duration: 150 } }
Timer {
running: card.modelData.urgency !== NotificationUrgency.Critical
id: dismissTimer
running: card.modelData.urgency !== NotificationUrgency.Critical && !hoverArea.containsMouse
interval: Config.notifications.timeout
repeat: false
onTriggered: card.modelData.dismiss()
}
Layout.fillWidth: true
implicitHeight: layout.implicitHeight + 20
radius: 12
color: Config.colors.bgDark
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
@@ -65,57 +70,97 @@ Scope {
: Config.colors.purple
}
RowLayout {
id: layout
ColumnLayout {
id: cardLayout
anchors.fill: parent
anchors.margins: 10
anchors.leftMargin: 18
spacing: 10
spacing: 8
Image {
Layout.preferredWidth: 36
Layout.preferredHeight: 36
Layout.alignment: Qt.AlignTop
fillMode: Image.PreserveAspectFit
visible: source.toString() !== ""
source: card.modelData.image || card.modelData.appIcon || ""
}
ColumnLayout {
RowLayout {
Layout.fillWidth: true
spacing: 2
spacing: 10
Text {
Layout.fillWidth: true
text: card.modelData.summary
color: Config.colors.cyan
font.family: Config.bar.fontFamily
font.pixelSize: Config.bar.fontSize
font.bold: true
elide: Text.ElideRight
Image {
Layout.preferredWidth: 36
Layout.preferredHeight: 36
Layout.alignment: Qt.AlignTop
fillMode: Image.PreserveAspectFit
visible: source.toString() !== ""
source: card.modelData.image || card.modelData.appIcon || ""
}
Text {
ColumnLayout {
Layout.fillWidth: true
visible: text !== ""
text: card.modelData.body
color: Config.colors.fg
spacing: 2
font.family: Config.bar.fontFamily
font.pixelSize: Config.bar.fontSize - 1
Text {
Layout.fillWidth: true
text: card.modelData.summary
color: Config.colors.cyan
font.family: Config.bar.fontFamily
font.pixelSize: Config.bar.fontSize
font.bold: true
elide: Text.ElideRight
}
wrapMode: Text.WordWrap
Text {
Layout.fillWidth: true
visible: text !== ""
text: card.modelData.body
color: Config.colors.fg
font.family: Config.bar.fontFamily
font.pixelSize: Config.bar.fontSize - 1
wrapMode: Text.WordWrap
maximumLineCount: 4
elide: Text.ElideRight
}
}
}
RowLayout {
Layout.fillWidth: true
visible: card.modelData.actions.length > 0
spacing: 8
Repeater {
model: card.modelData.actions
delegate: Rectangle {
required property var modelData
Layout.fillWidth: true
Layout.preferredHeight: 26
radius: 6
color: actionArea.containsMouse ? Config.colors.purple : Qt.rgba(1, 1, 1, 0.05)
Text {
anchors.centerIn: parent
text: parent.modelData.text
color: Config.colors.fg
font.family: Config.bar.fontFamily
font.pixelSize: Config.bar.fontSize - 2
}
MouseArea {
id: actionArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: card.modelData.invokeAction(parent.modelData.identifier)
}
}
}
}
}
MouseArea {
id: hoverArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: card.modelData.dismiss()
z: -1
}
}
}