feat: complete quickshell redesign
This commit is contained in:
1 parent
1eb0820083
commit
0ff727898a
25 files changed
+1410
-401
No files matched your search
@@ -6,6 +6,7 @@ import "../Shared"
|
||||
|
||||
PanelWindow {
|
||||
id: notifWindow
|
||||
property QtObject rootState
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
@@ -35,6 +36,12 @@ PanelWindow {
|
||||
|
||||
onNotification: notification => {
|
||||
notification.tracked = true;
|
||||
|
||||
// Do Not Disturb: the notification is still tracked/available
|
||||
// to whatever reads NotificationServer directly, just not
|
||||
// surfaced as a toast.
|
||||
if (notifWindow.rootState && notifWindow.rootState.dndEnabled) return;
|
||||
|
||||
toastModel.insert(0, {
|
||||
notifObj: notification,
|
||||
appName: notification.appName,
|
||||
@@ -101,76 +108,88 @@ PanelWindow {
|
||||
Repeater {
|
||||
model: toastModel
|
||||
|
||||
delegate: Rectangle {
|
||||
delegate: Surface {
|
||||
id: toast
|
||||
width: list.width
|
||||
height: content.implicitHeight + Theme.geometry.padding * 2
|
||||
radius: Theme.geometry.radiusMedium
|
||||
color: Qt.alpha(notifWindow.colorFor(model.urgency), 0.15)
|
||||
border.color: Qt.alpha(notifWindow.colorFor(model.urgency), 0.3)
|
||||
border.width: 1
|
||||
height: 20 + content.implicitHeight
|
||||
color: Theme.colors.surface
|
||||
tint: notifWindow.colorFor(model.urgency)
|
||||
glow: model.urgency === NotificationUrgency.Critical
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: Theme.animation.durationNormal } }
|
||||
|
||||
Row {
|
||||
id: content
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.margins: Theme.geometry.padding
|
||||
spacing: Theme.geometry.spacing
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
|
||||
// Solid accent header strip
|
||||
Rectangle {
|
||||
width: 16
|
||||
height: 16
|
||||
radius: 8
|
||||
width: parent.width
|
||||
height: 20
|
||||
color: notifWindow.colorFor(model.urgency)
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 2
|
||||
}
|
||||
|
||||
Column {
|
||||
width: content.width - 16 - Theme.geometry.spacing - closeIcon.width - Theme.geometry.spacing
|
||||
spacing: 2
|
||||
|
||||
Text {
|
||||
text: model.summary && model.summary.length > 0 ? model.summary : model.appName
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Theme.geometry.spacing
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: notifWindow.labelFor(model.urgency).toUpperCase() + " :: " + model.appName
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: 12
|
||||
font.bold: true
|
||||
color: notifWindow.colorFor(model.urgency)
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
Text {
|
||||
visible: model.body && model.body.length > 0
|
||||
text: model.body
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: 12
|
||||
color: Theme.colors.text
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: 3
|
||||
elide: Text.ElideRight
|
||||
font.pixelSize: Theme.type.caption
|
||||
color: Theme.colors.textOnAccent
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: closeIcon
|
||||
text: ""
|
||||
color: Theme.colors.textMuted
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: 12
|
||||
anchors.top: parent.top
|
||||
Row {
|
||||
id: content
|
||||
width: parent.width
|
||||
leftPadding: Theme.geometry.padding
|
||||
rightPadding: Theme.geometry.padding
|
||||
topPadding: Theme.geometry.spacing
|
||||
bottomPadding: Theme.geometry.spacing
|
||||
spacing: Theme.geometry.spacing
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -6
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
model.notifObj.dismiss();
|
||||
toastModel.remove(index);
|
||||
Column {
|
||||
width: content.width - content.leftPadding - content.rightPadding - closeIcon.width - Theme.geometry.spacing
|
||||
spacing: 2
|
||||
|
||||
Text {
|
||||
text: model.summary && model.summary.length > 0 ? model.summary : model.appName
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: 12
|
||||
font.bold: true
|
||||
color: Theme.colors.text
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
Text {
|
||||
visible: model.body && model.body.length > 0
|
||||
text: model.body
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: 12
|
||||
color: Theme.colors.textMuted
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: 3
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: closeIcon
|
||||
text: "✕"
|
||||
color: Theme.colors.textMuted
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: 12
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -6
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
model.notifObj.dismiss();
|
||||
toastModel.remove(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user