mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 21:02:06 -04:00
Squashed commit of the following:
commit051b7576f7Author: purian23 <purian23@gmail.com> Date: Sun Feb 15 16:38:45 2026 -0500 Height for realz commit7784488a61Author: purian23 <purian23@gmail.com> Date: Sun Feb 15 16:34:09 2026 -0500 Fix height and truncate text/URLs commit31b328d428Author: bbedward <bbedward@gmail.com> Date: Sun Feb 15 16:25:57 2026 -0500 notifications: handle URL encoding in markdown2html commitdbb04f74a2Author: bbedward <bbedward@gmail.com> Date: Sun Feb 15 16:10:20 2026 -0500 notifications: more comprehensive decoder commitb29c7192c2Author: bbedward <bbedward@gmail.com> Date: Sun Feb 15 15:51:37 2026 -0500 notifications: html unescape commit8a48fa11ecAuthor: purian23 <purian23@gmail.com> Date: Sun Feb 15 15:04:33 2026 -0500 Add expressive curve on init toast commitee124f5e04Author: purian23 <purian23@gmail.com> Date: Sun Feb 15 15:02:16 2026 -0500 Expressive curves on swipe & btn height commit0fce904635Author: purian23 <purian23@gmail.com> Date: Sun Feb 15 13:40:02 2026 -0500 Provide bottom button clearance commit00d3829999Author: bbedward <bbedward@gmail.com> Date: Sun Feb 15 13:24:31 2026 -0500 notifications: cleanup popup display logic commitfd05768059Author: purian23 <purian23@gmail.com> Date: Sun Feb 15 01:00:55 2026 -0500 Add Privacy Mode - Smoother notification expansions - Shadow & Privacy Toggles commit0dba11d845Author: purian23 <purian23@gmail.com> Date: Sat Feb 14 22:48:46 2026 -0500 Further M3 enhancements commit949c216964Author: purian23 <purian23@gmail.com> Date: Sat Feb 14 19:59:38 2026 -0500 Right-Click to set Rules on Notifications directly commit62bc25782cAuthor: bbedward <bbedward@gmail.com> Date: Fri Feb 13 21:44:27 2026 -0500 notifications: fix compact spacing, reveal header bar, add bottom center position, pointing hand cursor fix commited495d4396Author: purian23 <purian23@gmail.com> Date: Fri Feb 13 20:25:40 2026 -0500 Tighten init toast commitebe38322a0Author: purian23 <purian23@gmail.com> Date: Fri Feb 13 20:09:59 2026 -0500 Update more m3 baselines & spacing commitb1735bb701Author: purian23 <purian23@gmail.com> Date: Fri Feb 13 14:10:05 2026 -0500 Expand rules on-Click commit9f13546b4dAuthor: purian23 <purian23@gmail.com> Date: Fri Feb 13 12:59:29 2026 -0500 Add Notification Rules - Additional right-click ops - Allow for 3rd boy line on init notification popup commitbe133b73c7Author: purian23 <purian23@gmail.com> Date: Fri Feb 13 10:10:03 2026 -0500 Truncate long title in groups commit4fc275beadAuthor: bbedward <bbedward@gmail.com> Date: Thu Feb 12 23:27:34 2026 -0500 notification: expand/collapse animation adjustment commit00e6172a68Author: purian23 <purian23@gmail.com> Date: Thu Feb 12 22:50:11 2026 -0500 Fix global warnings commit0772f6deb7Author: purian23 <purian23@gmail.com> Date: Thu Feb 12 22:46:40 2026 -0500 Tweak expansion duration commit0ffeed3ff0Author: purian23 <purian23@gmail.com> Date: Thu Feb 12 22:16:16 2026 -0500 notifications: Update Material 3 baselines - New right-click to mute option - New independent Notification Animation settings
This commit is contained in:
@@ -6,6 +6,25 @@ import qs.Modules.Settings.Widgets
|
||||
Item {
|
||||
id: root
|
||||
|
||||
Component.onCompleted: {
|
||||
if (SettingsData._pendingExpandNotificationRules) {
|
||||
SettingsData._pendingExpandNotificationRules = false;
|
||||
notificationRulesCard.userToggledCollapse = true;
|
||||
notificationRulesCard.expanded = true;
|
||||
SettingsData._pendingNotificationRuleIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
readonly property var mutedRules: {
|
||||
var rules = SettingsData.notificationRules || [];
|
||||
var out = [];
|
||||
for (var i = 0; i < rules.length; i++) {
|
||||
if ((rules[i].action || "").toString().toLowerCase() === "mute")
|
||||
out.push({ rule: rules[i], index: i });
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
readonly property var timeoutOptions: [
|
||||
{
|
||||
text: I18n.tr("Never"),
|
||||
@@ -201,22 +220,33 @@ Item {
|
||||
return I18n.tr("Top Left", "screen position option");
|
||||
case SettingsData.Position.Right:
|
||||
return I18n.tr("Bottom Right", "screen position option");
|
||||
case SettingsData.Position.BottomCenter:
|
||||
return I18n.tr("Bottom Center", "screen position option");
|
||||
default:
|
||||
return I18n.tr("Top Right", "screen position option");
|
||||
}
|
||||
}
|
||||
options: [I18n.tr("Top Right", "screen position option"), I18n.tr("Top Left", "screen position option"), I18n.tr("Top Center", "screen position option"), I18n.tr("Bottom Right", "screen position option"), I18n.tr("Bottom Left", "screen position option")]
|
||||
options: [I18n.tr("Top Right", "screen position option"), I18n.tr("Top Left", "screen position option"), I18n.tr("Top Center", "screen position option"), I18n.tr("Bottom Center", "screen position option"), I18n.tr("Bottom Right", "screen position option"), I18n.tr("Bottom Left", "screen position option")]
|
||||
onValueChanged: value => {
|
||||
if (value === I18n.tr("Top Right", "screen position option")) {
|
||||
switch (value) {
|
||||
case I18n.tr("Top Right", "screen position option"):
|
||||
SettingsData.set("notificationPopupPosition", SettingsData.Position.Top);
|
||||
} else if (value === I18n.tr("Top Left", "screen position option")) {
|
||||
break;
|
||||
case I18n.tr("Top Left", "screen position option"):
|
||||
SettingsData.set("notificationPopupPosition", SettingsData.Position.Left);
|
||||
} else if (value === I18n.tr("Top Center", "screen position option")) {
|
||||
break;
|
||||
case I18n.tr("Top Center", "screen position option"):
|
||||
SettingsData.set("notificationPopupPosition", -1);
|
||||
} else if (value === I18n.tr("Bottom Right", "screen position option")) {
|
||||
break;
|
||||
case I18n.tr("Bottom Center", "screen position option"):
|
||||
SettingsData.set("notificationPopupPosition", SettingsData.Position.BottomCenter);
|
||||
break;
|
||||
case I18n.tr("Bottom Right", "screen position option"):
|
||||
SettingsData.set("notificationPopupPosition", SettingsData.Position.Right);
|
||||
} else if (value === I18n.tr("Bottom Left", "screen position option")) {
|
||||
break;
|
||||
case I18n.tr("Bottom Left", "screen position option"):
|
||||
SettingsData.set("notificationPopupPosition", SettingsData.Position.Bottom);
|
||||
break;
|
||||
}
|
||||
SettingsData.sendTestNotifications();
|
||||
}
|
||||
@@ -239,6 +269,95 @@ Item {
|
||||
checked: SettingsData.notificationCompactMode
|
||||
onToggled: checked => SettingsData.set("notificationCompactMode", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "notificationPopupShadowEnabled"
|
||||
tags: ["notification", "popup", "shadow", "radius", "rounded"]
|
||||
text: I18n.tr("Popup Shadow")
|
||||
description: I18n.tr("Show drop shadow on notification popups")
|
||||
checked: SettingsData.notificationPopupShadowEnabled
|
||||
onToggled: checked => SettingsData.set("notificationPopupShadowEnabled", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "notificationPopupPrivacyMode"
|
||||
tags: ["notification", "popup", "privacy", "body", "content", "hide"]
|
||||
text: I18n.tr("Privacy Mode")
|
||||
description: I18n.tr("Hide notification content until expanded; popups show collapsed by default")
|
||||
checked: SettingsData.notificationPopupPrivacyMode
|
||||
onToggled: checked => SettingsData.set("notificationPopupPrivacyMode", checked)
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: notificationAnimationColumn.implicitHeight + Theme.spacingM * 2
|
||||
|
||||
Column {
|
||||
id: notificationAnimationColumn
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Theme.spacingM
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Animation Speed")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.Medium
|
||||
color: Theme.surfaceText
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Control animation duration for notification popups and history")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
DankButtonGroup {
|
||||
id: notificationSpeedGroup
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
buttonPadding: parent.width < 480 ? Theme.spacingS : Theme.spacingM
|
||||
minButtonWidth: parent.width < 480 ? 44 : 56
|
||||
textSize: parent.width < 480 ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
||||
model: [I18n.tr("None"), I18n.tr("Short"), I18n.tr("Medium"), I18n.tr("Long"), I18n.tr("Custom")]
|
||||
selectionMode: "single"
|
||||
currentIndex: SettingsData.notificationAnimationSpeed
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (!selected)
|
||||
return;
|
||||
SettingsData.set("notificationAnimationSpeed", index);
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SettingsData
|
||||
function onNotificationAnimationSpeedChanged() {
|
||||
notificationSpeedGroup.currentIndex = SettingsData.notificationAnimationSpeed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSliderRow {
|
||||
settingKey: "notificationCustomAnimationDuration"
|
||||
tags: ["notification", "animation", "duration", "custom", "speed"]
|
||||
text: I18n.tr("Duration")
|
||||
description: I18n.tr("Base duration for animations (drag to use Custom)")
|
||||
minimum: 100
|
||||
maximum: 800
|
||||
value: Theme.notificationAnimationBaseDuration
|
||||
unit: "ms"
|
||||
defaultValue: 400
|
||||
onSliderValueChanged: newValue => {
|
||||
if (SettingsData.notificationAnimationSpeed !== SettingsData.AnimationSpeed.Custom) {
|
||||
SettingsData.set("notificationAnimationSpeed", SettingsData.AnimationSpeed.Custom);
|
||||
}
|
||||
SettingsData.set("notificationCustomAnimationDuration", newValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
@@ -258,6 +377,7 @@ Item {
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
id: notificationRulesCard
|
||||
width: parent.width
|
||||
iconName: "rule_settings"
|
||||
title: I18n.tr("Notification Rules")
|
||||
@@ -282,7 +402,11 @@ Item {
|
||||
iconSize: 20
|
||||
backgroundColor: Theme.surfaceContainer
|
||||
iconColor: Theme.primary
|
||||
onClicked: SettingsData.addNotificationRule()
|
||||
onClicked: {
|
||||
SettingsData.addNotificationRule();
|
||||
notificationRulesCard.userToggledCollapse = true;
|
||||
notificationRulesCard.expanded = true;
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -291,7 +415,7 @@ Item {
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Create rules to mute, ignore, hide from history, or override notification priority.")
|
||||
text: I18n.tr("Create rules to mute, ignore, hide from history, or override notification priority. Default only overrides priority; notifications still show normally.")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
@@ -407,6 +531,7 @@ Item {
|
||||
width: parent.width
|
||||
compactMode: true
|
||||
dropdownWidth: parent.width
|
||||
popupWidth: 165
|
||||
currentValue: root.getRuleOptionLabel(root.notificationRuleFieldOptions, modelData.field, root.notificationRuleFieldOptions[0].label)
|
||||
options: root.notificationRuleFieldOptions.map(o => o.label)
|
||||
onValueChanged: value => SettingsData.updateNotificationRuleField(index, "field", root.getRuleOptionValue(root.notificationRuleFieldOptions, value, "appName"))
|
||||
@@ -447,6 +572,7 @@ Item {
|
||||
width: parent.width
|
||||
compactMode: true
|
||||
dropdownWidth: parent.width
|
||||
popupWidth: 170
|
||||
currentValue: root.getRuleOptionLabel(root.notificationRuleActionOptions, modelData.action, root.notificationRuleActionOptions[0].label)
|
||||
options: root.notificationRuleActionOptions.map(o => o.label)
|
||||
onValueChanged: value => SettingsData.updateNotificationRuleField(index, "action", root.getRuleOptionValue(root.notificationRuleActionOptions, value, "default"))
|
||||
@@ -467,6 +593,7 @@ Item {
|
||||
width: parent.width
|
||||
compactMode: true
|
||||
dropdownWidth: parent.width
|
||||
popupWidth: 165
|
||||
currentValue: root.getRuleOptionLabel(root.notificationRuleUrgencyOptions, modelData.urgency, root.notificationRuleUrgencyOptions[0].label)
|
||||
options: root.notificationRuleUrgencyOptions.map(o => o.label)
|
||||
onValueChanged: value => SettingsData.updateNotificationRuleField(index, "urgency", root.getRuleOptionValue(root.notificationRuleUrgencyOptions, value, "default"))
|
||||
@@ -479,6 +606,95 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
width: parent.width
|
||||
iconName: "volume_off"
|
||||
title: I18n.tr("Muted Apps")
|
||||
settingKey: "mutedApps"
|
||||
tags: ["notification", "mute", "unmute", "popup"]
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: mutedRules.length > 0 ? I18n.tr("Apps with notification popups muted. Unmute or delete to remove.") : I18n.tr("No apps muted. Right-click a notification and choose \"Mute popups\" to add one here.")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
bottomPadding: Theme.spacingS
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: mutedRules
|
||||
|
||||
delegate: Rectangle {
|
||||
width: parent.width
|
||||
height: mutedRow.implicitHeight + Theme.spacingS * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, 0.5)
|
||||
|
||||
Row {
|
||||
id: mutedRow
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingS
|
||||
spacing: Theme.spacingM
|
||||
|
||||
StyledText {
|
||||
id: mutedAppLabel
|
||||
text: (modelData.rule && modelData.rule.pattern) ? modelData.rule.pattern : I18n.tr("Unknown")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Item {
|
||||
width: Math.max(0, parent.width - parent.spacing - mutedAppLabel.width - unmuteBtn.width - deleteBtn.width - Theme.spacingS * 5)
|
||||
height: 1
|
||||
}
|
||||
|
||||
DankButton {
|
||||
id: unmuteBtn
|
||||
text: I18n.tr("Unmute")
|
||||
backgroundColor: Theme.surfaceContainer
|
||||
textColor: Theme.primary
|
||||
onClicked: SettingsData.removeNotificationRule(modelData.index)
|
||||
}
|
||||
|
||||
Item {
|
||||
id: deleteBtn
|
||||
width: 28
|
||||
height: 28
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: deleteArea.containsMouse ? Theme.withAlpha(Theme.error, 0.2) : "transparent"
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "delete"
|
||||
size: 18
|
||||
color: deleteArea.containsMouse ? Theme.error : Theme.surfaceVariantText
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: deleteArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: SettingsData.removeNotificationRule(modelData.index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
width: parent.width
|
||||
iconName: "lock"
|
||||
|
||||
Reference in New Issue
Block a user