mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-14 23:25:23 -04:00
feat(notifications): user-configurable font size for notification summary and body (#2461)
* feat(notifications): add user-configurable font size for summary and body in notification popups * feat: add Unset for falling back to previous default values * fix: prek hook errors --------- Co-authored-by: Klesh Wong <kleshwong@gmail.com>
This commit is contained in:
@@ -115,3 +115,5 @@ core.*
|
||||
.direnv/
|
||||
quickshell/dms-plugins
|
||||
__pycache__
|
||||
|
||||
.vscode/
|
||||
|
||||
@@ -515,6 +515,8 @@ Singleton {
|
||||
property bool notepadUseMonospace: true
|
||||
property string notepadFontFamily: ""
|
||||
property real notepadFontSize: 14
|
||||
property real notificationSummaryFontSize: Spec.SPEC.notificationSummaryFontSize.def
|
||||
property real notificationBodyFontSize: Spec.SPEC.notificationBodyFontSize.def
|
||||
property bool notepadShowLineNumbers: false
|
||||
property real notepadTransparencyOverride: -1
|
||||
property real notepadLastCustomTransparency: 0.7
|
||||
|
||||
@@ -260,6 +260,8 @@ var SPEC = {
|
||||
notepadUseMonospace: { def: true },
|
||||
notepadFontFamily: { def: "" },
|
||||
notepadFontSize: { def: 14 },
|
||||
notificationSummaryFontSize: { def: 0 },
|
||||
notificationBodyFontSize: { def: 0 },
|
||||
notepadShowLineNumbers: { def: false },
|
||||
notepadTransparencyOverride: { def: -1 },
|
||||
notepadLastCustomTransparency: { def: 0.7 },
|
||||
|
||||
@@ -922,10 +922,11 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
StyledText {
|
||||
text: notificationData ? (notificationData.summary || "") : ""
|
||||
color: Theme.surfaceText
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.pixelSize: SettingsData.notificationSummaryFontSize || Theme.fontSizeMedium
|
||||
font.weight: Font.Medium
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
@@ -941,7 +942,7 @@ PanelWindow {
|
||||
text: notificationData ? (notificationData.htmlBody || "") : ""
|
||||
textFormat: Text.StyledText
|
||||
color: Theme.surfaceVariantText
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.pixelSize: SettingsData.notificationBodyFontSize || Theme.fontSizeSmall
|
||||
width: parent.width
|
||||
elide: descriptionExpanded ? Text.ElideNone : Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
|
||||
@@ -200,12 +200,40 @@ Item {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: Theme.spacingXL
|
||||
|
||||
|
||||
SettingsCard {
|
||||
width: parent.width
|
||||
iconName: "notifications"
|
||||
title: I18n.tr("Notification Popups")
|
||||
settingKey: "notificationPopups"
|
||||
|
||||
// Font size selectors for summary and body
|
||||
SettingsDropdownRow {
|
||||
settingKey: "notificationSummaryFontSize"
|
||||
tags: ["notification", "font", "summary", "size"]
|
||||
text: I18n.tr("Summary Font Size")
|
||||
description: I18n.tr("Set the font size for notification summary text")
|
||||
options: [I18n.tr("Unset"), "10", "12", "14", "16", "18"]
|
||||
currentValue: (SettingsData.notificationSummaryFontSize || I18n.tr("Unset")).toString()
|
||||
onValueChanged: value => {
|
||||
SettingsData.set("notificationSummaryFontSize", Number(value === I18n.tr("Unset") ? 0 : value));
|
||||
SettingsData.sendTestNotifications();
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDropdownRow {
|
||||
settingKey: "notificationBodyFontSize"
|
||||
tags: ["notification", "font", "body", "size"]
|
||||
text: I18n.tr("Body Font Size")
|
||||
description: I18n.tr("Set the font size for notification body text (htmlBody)")
|
||||
options: [I18n.tr("Unset"), "10", "12", "14", "16", "18"]
|
||||
currentValue: (SettingsData.notificationBodyFontSize || I18n.tr("Unset")).toString()
|
||||
onValueChanged: value => {
|
||||
SettingsData.set("notificationBodyFontSize", Number(value === I18n.tr("Unset") ? 0 : value));
|
||||
SettingsData.sendTestNotifications();
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDropdownRow {
|
||||
settingKey: "notificationPopupPosition"
|
||||
tags: ["notification", "popup", "position", "screen", "location"]
|
||||
|
||||
Reference in New Issue
Block a user