Merge pull request #722 from Sridou/dev

Reset button for notification timeout values
This commit is contained in:
Lemmy
2025-11-11 19:17:48 -05:00
committed by GitHub
3 changed files with 64 additions and 2 deletions
+1
View File
@@ -1378,6 +1378,7 @@
"description": "Use the expire timeout set in the notification.",
"label": "Respect expire timeout"
},
"reset": "Reset timeout duration",
"section": {
"description": "Configure how long notifications stay visible based on their urgency level.",
"label": "Notification duration"
@@ -137,6 +137,11 @@ ColumnLayout {
description: I18n.tr("settings.notifications.duration.low-urgency.description")
}
RowLayout {
spacing: Style.marginL
Layout.fillWidth: true
NValueSlider {
Layout.fillWidth: true
from: 1
@@ -146,7 +151,22 @@ ColumnLayout {
onMoved: value => Settings.data.notifications.lowUrgencyDuration = value
text: Settings.data.notifications.lowUrgencyDuration + "s"
}
}
// Reset button container
Item {
Layout.preferredWidth: 30 * Style.uiScaleRatio
Layout.preferredHeight: 30 * Style.uiScaleRatio
NIconButton {
icon: "refresh"
baseSize: Style.baseWidgetSize * 0.8
tooltipText: I18n.tr("settings.notifications.duration.reset")
onClicked: Settings.data.notifications.lowUrgencyDuration = 3
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
// Normal Urgency Duration
ColumnLayout {
@@ -158,6 +178,10 @@ ColumnLayout {
description: I18n.tr("settings.notifications.duration.normal-urgency.description")
}
RowLayout {
spacing: Style.marginL
Layout.fillWidth: true
NValueSlider {
Layout.fillWidth: true
from: 1
@@ -167,6 +191,22 @@ ColumnLayout {
onMoved: value => Settings.data.notifications.normalUrgencyDuration = value
text: Settings.data.notifications.normalUrgencyDuration + "s"
}
// Reset button container
Item {
Layout.preferredWidth: 30 * Style.uiScaleRatio
Layout.preferredHeight: 30 * Style.uiScaleRatio
NIconButton {
icon: "refresh"
baseSize: Style.baseWidgetSize * 0.8
tooltipText: I18n.tr("settings.notifications.duration.reset")
onClicked: Settings.data.notifications.normalUrgencyDuration = 8
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
// Critical Urgency Duration
@@ -179,6 +219,10 @@ ColumnLayout {
description: I18n.tr("settings.notifications.duration.critical-urgency.description")
}
RowLayout {
spacing: Style.marginL
Layout.fillWidth: true
NValueSlider {
Layout.fillWidth: true
from: 1
@@ -188,8 +232,23 @@ ColumnLayout {
onMoved: value => Settings.data.notifications.criticalUrgencyDuration = value
text: Settings.data.notifications.criticalUrgencyDuration + "s"
}
}
// Reset button container
Item {
Layout.preferredWidth: 30 * Style.uiScaleRatio
Layout.preferredHeight: 30 * Style.uiScaleRatio
NIconButton {
icon: "refresh"
baseSize: Style.baseWidgetSize * 0.8
tooltipText: I18n.tr("settings.notifications.duration.reset")
onClicked: Settings.data.notifications.criticalUrgencyDuration = 15
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
NDivider {
Layout.fillWidth: true
Layout.topMargin: Style.marginL
@@ -125,6 +125,7 @@ ColumnLayout {
Layout.bottomMargin: Style.marginL
}
// User Interface
ColumnLayout {
spacing: Style.marginXXS
Layout.fillWidth: true
@@ -165,6 +166,7 @@ ColumnLayout {
}
}
// Border Radius
ColumnLayout {
spacing: Style.marginXXS
Layout.fillWidth: true