From 7ee13837b13ba1cf032738ebc19ba491fe842486 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Mon, 22 Oct 2018 13:16:58 +0800 Subject: [PATCH] Working on #64. It can now navigate to read marker only if the event is in timeline. --- .../Spectral/Panel/RoomListPanelForm.ui.qml | 4 ---- imports/Spectral/Panel/RoomPanel.qml | 1 + imports/Spectral/Panel/RoomPanelForm.ui.qml | 21 +++++++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/imports/Spectral/Panel/RoomListPanelForm.ui.qml b/imports/Spectral/Panel/RoomListPanelForm.ui.qml index 6ce148433..81566d10d 100644 --- a/imports/Spectral/Panel/RoomListPanelForm.ui.qml +++ b/imports/Spectral/Panel/RoomListPanelForm.ui.qml @@ -43,10 +43,6 @@ Rectangle { Layout.margins: 12 color: MSettings.darkTheme ? "#303030" : "#fafafa" -// layer.enabled: true -// layer.effect: ElevationEffect { -// elevation: searchField.focus ? 2 : 1 -// } RowLayout { anchors.fill: parent diff --git a/imports/Spectral/Panel/RoomPanel.qml b/imports/Spectral/Panel/RoomPanel.qml index f1d30f882..3d2ca6f79 100644 --- a/imports/Spectral/Panel/RoomPanel.qml +++ b/imports/Spectral/Panel/RoomPanel.qml @@ -39,6 +39,7 @@ RoomPanelForm { } } + goBottomFab.onClicked: goToEvent(currentRoom.readMarkerEventId) goTopFab.onClicked: messageListView.positionViewAtBeginning() function goToEvent(eventID) { diff --git a/imports/Spectral/Panel/RoomPanelForm.ui.qml b/imports/Spectral/Panel/RoomPanelForm.ui.qml index 9163c303f..410454b22 100644 --- a/imports/Spectral/Panel/RoomPanelForm.ui.qml +++ b/imports/Spectral/Panel/RoomPanelForm.ui.qml @@ -22,6 +22,7 @@ Item { property alias roomHeader: roomHeader property alias messageListView: messageListView property alias goTopFab: goTopFab + property alias goBottomFab: goBottomFab property alias messageEventModel: messageEventModel property alias sortedMessageEventModel: sortedMessageEventModel property alias roomDrawer: roomDrawer @@ -153,6 +154,26 @@ Item { } } + RoundButton { + width: 64 + height: 64 + anchors.right: parent.right + anchors.top: parent.top + + id: goBottomFab + + visible: currentRoom && currentRoom.hasUnreadMessages + + contentItem: MaterialIcon { + anchors.fill: parent + + icon: "\ue316" + color: "white" + } + + Material.background: Material.accent + } + RoundButton { width: 64 height: 64