Renamed most font and sizing shorthands properties for easier understanding and maintenance

property real fontSizeXS: 9
  property real fontSizeS: 10
  property real fontSizeM: 11
  property real fontSizeL: 13
  property real fontSizeXL: 16
  property real fontSizeXXL: 18
  property real fontSizeXXXL: 24
This commit is contained in:
quadbyte 2025-08-18 11:12:51 -04:00
parent ddd74c65e4
commit b723eccc78
56 changed files with 1419 additions and 1423 deletions

View file

@ -34,8 +34,8 @@ Variants {
anchors.top: true
anchors.right: true
margins.top: (Style.barHeight + Style.marginMedium) * scaling
margins.right: Style.marginMedium * scaling
margins.top: (Style.barHeight + Style.marginM) * scaling
margins.right: Style.marginM * scaling
implicitWidth: 360 * scaling
implicitHeight: Math.min(notificationStack.implicitHeight, (NotificationService.maxVisible * 120) * scaling)
WlrLayershell.layer: WlrLayer.Overlay
@ -59,7 +59,7 @@ Variants {
id: notificationStack
anchors.top: parent.top
anchors.right: parent.right
spacing: Style.marginSmall * scaling
spacing: Style.marginS * scaling
width: 360 * scaling
visible: true
@ -68,11 +68,11 @@ Variants {
model: notificationModel
delegate: Rectangle {
width: 360 * scaling
height: Math.max(80 * scaling, contentColumn.implicitHeight + (Style.marginMedium * 2 * scaling))
height: Math.max(80 * scaling, contentColumn.implicitHeight + (Style.marginM * 2 * scaling))
clip: true
radius: Style.radiusMedium * scaling
radius: Style.radiusM * scaling
border.color: Color.mPrimary
border.width: Math.max(1, Style.borderThin * scaling)
border.width: Math.max(1, Style.borderS * scaling)
color: Color.mSurface
// Animation properties
@ -134,20 +134,20 @@ Variants {
Column {
id: contentColumn
anchors.fill: parent
anchors.margins: Style.marginMedium * scaling
spacing: Style.marginSmall * scaling
anchors.margins: Style.marginM * scaling
spacing: Style.marginS * scaling
RowLayout {
spacing: Style.marginSmall * scaling
spacing: Style.marginS * scaling
NText {
text: (model.appName || model.desktopEntry) || "Unknown App"
color: Color.mSecondary
font.pointSize: Style.fontSizeSmall * scaling
font.pointSize: Style.fontSizeXS * scaling
}
Rectangle {
width: 6 * scaling
height: 6 * scaling
radius: Style.radiusTiny * scaling
radius: Style.radiusXS * scaling
color: (model.urgency === NotificationUrgency.Critical) ? Color.mError : (model.urgency === NotificationUrgency.Low) ? Color.mOnSurface : Color.mPrimary
Layout.alignment: Qt.AlignVCenter
}
@ -157,13 +157,13 @@ Variants {
NText {
text: NotificationService.formatTimestamp(model.timestamp)
color: Color.mOnSurface
font.pointSize: Style.fontSizeSmall * scaling
font.pointSize: Style.fontSizeXS * scaling
}
}
NText {
text: model.summary || "No summary"
font.pointSize: Style.fontSizeLarge * scaling
font.pointSize: Style.fontSizeL * scaling
font.weight: Style.fontWeightBold
color: Color.mOnSurface
wrapMode: Text.Wrap
@ -174,7 +174,7 @@ Variants {
NText {
text: model.body || ""
font.pointSize: Style.fontSizeSmall * scaling
font.pointSize: Style.fontSizeXS * scaling
color: Color.mOnSurface
wrapMode: Text.Wrap
width: 300 * scaling
@ -190,7 +190,7 @@ Variants {
showBorder: false
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: Style.marginSmall * scaling
anchors.margins: Style.marginS * scaling
onClicked: {
animateOut()

View file

@ -67,15 +67,15 @@ NLoader {
Rectangle {
id: notificationRect
color: Color.mSurface
radius: Style.radiusLarge * scaling
radius: Style.radiusL * scaling
border.color: Color.mOutlineVariant
border.width: Math.max(1, Style.borderThin * scaling)
border.width: Math.max(1, Style.borderS * scaling)
width: 400 * scaling
height: 500 * scaling
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: Style.marginTiny * scaling
anchors.rightMargin: Style.marginTiny * scaling
anchors.topMargin: Style.marginXS * scaling
anchors.rightMargin: Style.marginXS * scaling
clip: true
// Animation properties
@ -108,22 +108,22 @@ NLoader {
ColumnLayout {
anchors.fill: parent
anchors.margins: Style.marginLarge * scaling
spacing: Style.marginMedium * scaling
anchors.margins: Style.marginL * scaling
spacing: Style.marginM * scaling
RowLayout {
Layout.fillWidth: true
spacing: Style.marginMedium * scaling
spacing: Style.marginM * scaling
NIcon {
text: "notifications"
font.pointSize: Style.fontSizeXL * scaling
font.pointSize: Style.fontSizeXXL * scaling
color: Color.mPrimary
}
NText {
text: "Notification History"
font.pointSize: Style.fontSizeLarge * scaling
font.pointSize: Style.fontSizeL * scaling
font.bold: true
color: Color.mOnSurface
Layout.fillWidth: true
@ -156,18 +156,18 @@ NLoader {
ColumnLayout {
anchors.centerIn: parent
spacing: Style.marginMedium * scaling
spacing: Style.marginM * scaling
NIcon {
text: "notifications_off"
font.pointSize: Style.fontSizeXXL * scaling
font.pointSize: Style.fontSizeXXXL * scaling
color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter
}
NText {
text: "No notifications"
font.pointSize: Style.fontSizeLarge * scaling
font.pointSize: Style.fontSizeL * scaling
color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter
}
@ -186,7 +186,7 @@ NLoader {
Layout.fillWidth: true
Layout.fillHeight: true
model: NotificationService.historyModel
spacing: Style.marginMedium * scaling
spacing: Style.marginM * scaling
clip: true
boundsBehavior: Flickable.StopAtBounds
visible: NotificationService.historyModel.count > 0
@ -194,26 +194,26 @@ NLoader {
delegate: Rectangle {
width: notificationList ? (notificationList.width - 20) : 380 * scaling
height: Math.max(80, notificationContent.height + 30)
radius: Style.radiusMedium * scaling
radius: Style.radiusM * scaling
color: notificationMouseArea.containsMouse ? Color.mPrimary : Color.mSurfaceVariant
RowLayout {
anchors {
fill: parent
margins: Style.marginMedium * scaling
margins: Style.marginM * scaling
}
spacing: Style.marginMedium * scaling
spacing: Style.marginM * scaling
// Notification content
Column {
id: notificationContent
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
spacing: Style.marginTiniest * scaling
spacing: Style.marginXXS * scaling
NText {
text: (summary || "No summary").substring(0, 100)
font.pointSize: Style.fontSizeMedium * scaling
font.pointSize: Style.fontSizeM * scaling
font.weight: Font.Medium
color: notificationMouseArea.containsMouse ? Color.mSurface : Color.mOnSurface
wrapMode: Text.Wrap
@ -224,7 +224,7 @@ NLoader {
NText {
text: (body || "").substring(0, 150)
font.pointSize: Style.fontSizeSmall * scaling
font.pointSize: Style.fontSizeXS * scaling
color: notificationMouseArea.containsMouse ? Color.mSurface : Color.mOnSurface
wrapMode: Text.Wrap
width: parent.width - 60
@ -234,7 +234,7 @@ NLoader {
NText {
text: NotificationService.formatTimestamp(timestamp)
font.pointSize: Style.fontSizeSmall * scaling
font.pointSize: Style.fontSizeXS * scaling
color: notificationMouseArea.containsMouse ? Color.mSurface : Color.mOnSurface
}
}
@ -256,7 +256,7 @@ NLoader {
MouseArea {
id: notificationMouseArea
anchors.fill: parent
anchors.rightMargin: Style.marginLarge * 3 * scaling
anchors.rightMargin: Style.marginL * 3 * scaling
hoverEnabled: true
// Remove the onClicked handler since we now have a dedicated delete button
}