Add Activity date and time
authorMichael Schuster <michael@schuster.ms>
Fri, 17 Jan 2020 19:16:20 +0000 (20:16 +0100)
committerMichael Schuster <michael@schuster.ms>
Fri, 17 Jan 2020 19:16:20 +0000 (20:16 +0100)
Signed-off-by: Michael Schuster <michael@schuster.ms>
src/gui/tray/ActivityListModel.cpp
src/gui/tray/Window.qml

index 75200a9395db18de68198e6a3807731beb3f89e2..dc1b109f6721cb837970702b7b53d8c1cce84966 100644 (file)
@@ -51,6 +51,7 @@ QHash<int, QByteArray> ActivityListModel::roleNames() const
     roles[ActionIconRole] = "icon";
     roles[ActionTextRole] = "subject";
     roles[ObjectTypeRole] = "objectType";
+    roles[PointInTimeRole] = "dateTime";
     return roles;
 }
 
@@ -184,7 +185,7 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
     case AccountRole:
         return a._accName;
     case PointInTimeRole:
-        return QString("%1 (%2)").arg(a._dateTime.toLocalTime().toString(Qt::DefaultLocaleShortDate), Utility::timeAgoInWords(a._dateTime.toLocalTime()));
+        return QString("%1 - %2").arg(Utility::timeAgoInWords(a._dateTime.toLocalTime()), a._dateTime.toLocalTime().toString(Qt::DefaultLocaleShortDate));
     case AccountConnectedRole:
         return (ast && ast->isConnected());
     default:
index f3fed155a9601cb1b25dc02e6964cd541e2f341b..9fd16c82f0f7dee7e7619894b0e58ad6d025100c 100644 (file)
@@ -538,6 +538,16 @@ Window {
                         elide: Text.ElideRight\r
                         font.pixelSize: 10\r
                     }\r
+\r
+                    Text {\r
+                        id: activityTextDateTime\r
+                        text: dateTime\r
+                        height: (text === "") ? 0 : activityTextTitle.height\r
+                        width: 240 + ((path === "") ? activityItem.height : 0) + ((link === "") ? activityItem.height : 0) - 8\r
+                        elide: Text.ElideRight\r
+                        font.pixelSize: 10\r
+                        color: "#808080"\r
+                    }\r
                 }\r
                 Item {\r
                     id: activityItemFiller\r