[applets/notifications] Show "Just now" time label for recent notifications

wilder-5.26
ivan tkachenko 4 years ago
parent 0536cf4140
commit 8adfa3d7fd
No known key found for this signature in database
GPG Key ID: AF72731B7C654CB3
  1. 6
      applets/notifications/package/contents/ui/NotificationHeader.qml
  2. 1
      applets/notifications/package/contents/ui/NotificationItem.qml

@ -23,6 +23,7 @@ import "global"
RowLayout {
id: notificationHeading
property bool inGroup
property bool inHistory
property int notificationType
property var applicationIconSource
@ -114,7 +115,10 @@ RowLayout {
var deltaMinutes = Math.floor((Date.now() - time.getTime()) / 1000 / 60);
if (deltaMinutes < 1) {
return "";
// "Just now" is implied by
return notificationHeading.inHistory
? i18ndc("plasma_applet_org.kde.plasma.notifications", "Notification was added less than a minute ago, keep short", "Just now")
: "";
}
// Received less than an hour ago, show relative minutes

@ -130,6 +130,7 @@ ColumnLayout {
PlasmaCore.ColorScope.inherit: false
inGroup: notificationItem.inGroup
inHistory: notificationItem.inHistory
notificationType: notificationItem.notificationType
jobState: notificationItem.jobState

Loading…
Cancel
Save