fixed notifications font rendering

This commit is contained in:
SomeElse
2026-05-16 21:17:45 +00:00
parent 526607ee8d
commit 0c7b5188a8
15 changed files with 292 additions and 590 deletions

View File

@@ -6,18 +6,11 @@ import Quickshell.Wayland
import Quickshell.Services.Notifications
import "../../config" as Cfg
import "../../components"
Rectangle {
ModuleChip {
id: root
property real panelRadius: Cfg.Config.radius / 2
property int borderWidth: Cfg.Config.panelBorderWidth
property bool isTop: true
property var targetScreen: null
property int barHeight: Cfg.Config.barHeight
property int barMargin: Cfg.Config.margin
readonly property var t: Cfg.Config.theme
property int unreadCount: 0
property bool doNotDisturb: false
property bool historyOpen: historyPopup.popupOpen
@@ -111,7 +104,6 @@ Rectangle {
? toastRoot.t.notifUrgencyCritical
: (cardHover.hovered ? toastRoot.t.notifBorderActive : toastRoot.t.notifToastBorder)
border.width: Cfg.Config.popupBorderWidth
layer.enabled: true
Behavior on color { ColorAnimation { duration: 150; easing.type: Easing.OutCubic } }
Behavior on border.color { ColorAnimation { duration: 150 } }
@@ -152,22 +144,26 @@ Rectangle {
color: toastRoot.urgencyColor(toastRoot.urgency)
font.pixelSize: 12
Layout.alignment: Qt.AlignVCenter
renderType: Text.NativeRendering
}
Text {
text: toastRoot.appName
color: toastRoot.t.notifToastAppName
font.pixelSize: 11
font.pixelSize: 12
font.bold: true
font.capitalization: Font.AllUppercase
font.letterSpacing: 0.4
Layout.fillWidth: true
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
Text {
text: toastRoot.timeStr
color: toastRoot.t.notifToastDim
font.pixelSize: 10
font.pixelSize: 11
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
Rectangle {
@@ -181,6 +177,7 @@ Rectangle {
text: "✕"
color: closeHover.hovered ? toastRoot.t.notifToastText : toastRoot.t.notifToastDim
font.pixelSize: 10
renderType: Text.NativeRendering
}
HoverHandler { id: closeHover; cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: toastRoot.triggerDismiss() }
@@ -196,6 +193,7 @@ Rectangle {
elide: Text.ElideRight
textFormat: Text.PlainText
visible: toastRoot.summary !== ""
renderType: Text.NativeRendering
}
Text {
@@ -209,7 +207,8 @@ Rectangle {
textFormat: Text.PlainText
visible: toastRoot.body !== ""
Layout.bottomMargin: toastRoot.urgency === NotificationUrgency.Low ? 6 : 0
lineHeight: 1.15
lineHeight: 1.2
renderType: Text.NativeRendering
}
}
@@ -286,7 +285,7 @@ Rectangle {
Behavior on opacity { NumberAnimation { duration: 150 } }
Behavior on color { ColorAnimation { duration: 150 } }
Text { anchors.centerIn: parent; text: "✕"; color: histRoot.t.notifToastText; font.pixelSize: 10 }
Text { anchors.centerIn: parent; text: "✕"; color: histRoot.t.notifToastText; font.pixelSize: 10; renderType: Text.NativeRendering }
HoverHandler { id: histCloseHover; cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: dismissAnim.start() }
}
@@ -298,21 +297,24 @@ Rectangle {
RowLayout {
Layout.fillWidth: true; spacing: 5
Text { text: histRoot.urgencyIcon(histRoot.urgency); color: histRoot.urgencyColor(histRoot.urgency); font.pixelSize: 11; Layout.alignment: Qt.AlignVCenter }
Text { text: histRoot.urgencyIcon(histRoot.urgency); color: histRoot.urgencyColor(histRoot.urgency); font.pixelSize: 11; Layout.alignment: Qt.AlignVCenter; renderType: Text.NativeRendering }
Text {
text: histRoot.appName; color: histRoot.t.notifToastAppName; font.pixelSize: 11; font.bold: true
font.capitalization: Font.AllUppercase; Layout.fillWidth: true; elide: Text.ElideRight; verticalAlignment: Text.AlignVCenter
text: histRoot.appName; color: histRoot.t.notifToastAppName; font.pixelSize: 12; font.bold: true
font.capitalization: Font.AllUppercase; font.letterSpacing: 0.4; Layout.fillWidth: true; elide: Text.ElideRight; verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
Text { text: histRoot.timeStr; color: histRoot.t.notifToastDim; font.pixelSize: 11; verticalAlignment: Text.AlignVCenter }
Text { text: histRoot.timeStr; color: histRoot.t.notifToastDim; font.pixelSize: 11; verticalAlignment: Text.AlignVCenter; renderType: Text.NativeRendering }
}
Text {
text: histRoot.summary; color: histRoot.t.notifToastText; font.pixelSize: 13; font.bold: true
Layout.fillWidth: true; elide: Text.ElideRight; textFormat: Text.PlainText; visible: histRoot.summary !== ""
renderType: Text.NativeRendering
}
Text {
text: histRoot.body; color: histRoot.t.notifToastDim; font.pixelSize: 12; Layout.fillWidth: true
wrapMode: Text.WordWrap; maximumLineCount: 2; elide: Text.ElideRight; textFormat: Text.PlainText; visible: histRoot.body !== ""; lineHeight: 1.15
wrapMode: Text.WordWrap; maximumLineCount: 2; elide: Text.ElideRight; textFormat: Text.PlainText; visible: histRoot.body !== ""; lineHeight: 1.2
renderType: Text.NativeRendering
}
}
}
@@ -375,6 +377,7 @@ Rectangle {
color: t.notifBadgeText
font.pixelSize: 8
font.bold: true
renderType: Text.NativeRendering
}
}
}
@@ -574,7 +577,6 @@ Rectangle {
radius: Cfg.Config.popupRadius
border.color: t.notifHistoryBorder
border.width: Cfg.Config.popupBorderWidth
layer.enabled: true
MouseArea { anchors.fill: parent; propagateComposedEvents: false }
@@ -584,10 +586,10 @@ Rectangle {
anchors.topMargin: 20; anchors.leftMargin: 20; anchors.rightMargin: 20
spacing: 10
Text { text: "󰂚"; color: t.notifToastAppName; font.pixelSize: 18; Layout.alignment: Qt.AlignVCenter }
Text { text: "󰂚"; color: t.notifToastAppName; font.pixelSize: 18; Layout.alignment: Qt.AlignVCenter; renderType: Text.NativeRendering }
Text {
text: "Notifications"; color: t.notifToastAppName; font.pixelSize: 15; font.bold: true
Layout.fillWidth: true; Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true; Layout.alignment: Qt.AlignVCenter; renderType: Text.NativeRendering
}
Rectangle {
@@ -613,6 +615,7 @@ Rectangle {
font.pixelSize: 12
anchors.verticalCenter: parent.verticalCenter
Behavior on color { ColorAnimation { duration: 150 } }
renderType: Text.NativeRendering
}
Text {
text: root.doNotDisturb ? "On" : "Off"
@@ -621,6 +624,7 @@ Rectangle {
font.bold: root.doNotDisturb
anchors.verticalCenter: parent.verticalCenter
Behavior on color { ColorAnimation { duration: 150 } }
renderType: Text.NativeRendering
}
}
@@ -637,7 +641,7 @@ Rectangle {
color: clearHover.hovered ? t.notifHistoryHover : "transparent"
Behavior on color { ColorAnimation { duration: 150 } }
Text { id: clearText; anchors.centerIn: parent; text: "Clear all"; color: t.notifToastDim; font.pixelSize: 11 }
Text { id: clearText; anchors.centerIn: parent; text: "Clear all"; color: t.notifToastDim; font.pixelSize: 11; renderType: Text.NativeRendering }
HoverHandler { id: clearHover; cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: clearAllAnim.start() }
}
@@ -689,8 +693,8 @@ Rectangle {
width: histCol.width - 16; height: 90; visible: notifHistory.count === 0
ColumnLayout {
anchors.centerIn: parent; spacing: 8
Text { text: "󰂚"; color: t.notifHistoryEmpty; font.pixelSize: 30; Layout.alignment: Qt.AlignHCenter }
Text { text: "No notifications"; color: t.notifHistoryEmpty; font.pixelSize: 12; Layout.alignment: Qt.AlignHCenter }
Text { text: "󰂚"; color: t.notifHistoryEmpty; font.pixelSize: 30; Layout.alignment: Qt.AlignHCenter; renderType: Text.NativeRendering }
Text { text: "No notifications"; color: t.notifHistoryEmpty; font.pixelSize: 12; Layout.alignment: Qt.AlignHCenter; renderType: Text.NativeRendering }
}
}