From 27b914b0bfeb2ac2fe2a0b8e500d26eb0bc49b23 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 10 Jul 2020 12:13:11 -0400 Subject: [PATCH] Tell user when not loading history due to offline --- src/gui/Pages/Chat/Timeline/EventList.qml | 16 ++++- .../thin/feature-unavailable-offline.svg | 3 + src/icons/thin/presence-busy.svg | 4 +- src/icons/thin/presence-invisible.svg | 23 +++--- src/icons/thin/presence-offline.svg | 71 ++----------------- src/icons/thin/presence-online.svg | 4 +- 6 files changed, 37 insertions(+), 84 deletions(-) create mode 100644 src/icons/thin/feature-unavailable-offline.svg diff --git a/src/gui/Pages/Chat/Timeline/EventList.qml b/src/gui/Pages/Chat/Timeline/EventList.qml index d3730884..92c00c09 100644 --- a/src/gui/Pages/Chat/Timeline/EventList.qml +++ b/src/gui/Pages/Chat/Timeline/EventList.qml @@ -212,12 +212,24 @@ Rectangle { Behavior on opacity { HNumberAnimation {} } HButton { + readonly property bool offline: + chat.userInfo.presence === "offline" + id: button width: Math.min(parent.width, implicitWidth) anchors.centerIn: parent - loading: parent.visible - text: qsTr("Loading previous messages...") + loading: parent.visible && ! offline + icon.name: offline ? "feature-unavailable-offline" : "" + icon.color: + offline ? + theme.colors.negativeBackground : + theme.icons.colorize + text: + offline ? + qsTr("Cannot load history offline") : + qsTr("Loading previous messages...") + enableRadius: true iconItem.small: true } diff --git a/src/icons/thin/feature-unavailable-offline.svg b/src/icons/thin/feature-unavailable-offline.svg new file mode 100644 index 00000000..c67f60b2 --- /dev/null +++ b/src/icons/thin/feature-unavailable-offline.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/icons/thin/presence-busy.svg b/src/icons/thin/presence-busy.svg index 60aeca8b..5d5389f8 100644 --- a/src/icons/thin/presence-busy.svg +++ b/src/icons/thin/presence-busy.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/src/icons/thin/presence-invisible.svg b/src/icons/thin/presence-invisible.svg index a777f95f..c3985ab0 100644 --- a/src/icons/thin/presence-invisible.svg +++ b/src/icons/thin/presence-invisible.svg @@ -1,13 +1,10 @@ - - - - background - - - - Layer 1 - - - - - \ No newline at end of file + + + + + + + + + + diff --git a/src/icons/thin/presence-offline.svg b/src/icons/thin/presence-offline.svg index 3bd1ce1e..0c71cf40 100644 --- a/src/icons/thin/presence-offline.svg +++ b/src/icons/thin/presence-offline.svg @@ -1,68 +1,5 @@ - - - - - - image/svg+xml - - - - - - - - - - + + + + diff --git a/src/icons/thin/presence-online.svg b/src/icons/thin/presence-online.svg index 8fa51c2e..405b2462 100644 --- a/src/icons/thin/presence-online.svg +++ b/src/icons/thin/presence-online.svg @@ -1 +1,3 @@ - \ No newline at end of file + + +