summary refs log tree commit diff
path: root/resources/qml/TopBar.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-02-04 18:47:17 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-02-04 20:48:14 +0100
commit7b00411dc44d188ec1deab302fbcdb0bd2a399e7 (patch)
tree32934f5fc2c32fc4b4b0f5b6f4134baa78e1a265 /resources/qml/TopBar.qml
parentMerge pull request #906 from LorenDB/offlineIndicator (diff)
downloadnheko-7b00411dc44d188ec1deab302fbcdb0bd2a399e7.tar.xz
Show widgets as links
Diffstat (limited to 'resources/qml/TopBar.qml')
-rw-r--r--resources/qml/TopBar.qml40
1 files changed, 38 insertions, 2 deletions
diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml
index c9a8d0d2..77eed1b0 100644
--- a/resources/qml/TopBar.qml
+++ b/resources/qml/TopBar.qml
@@ -36,7 +36,7 @@ Pane {
 
     TapHandler {
         onSingleTapped: {
-            if (eventPoint.position.y > topBar.height - (pinnedMessages.visible ? pinnedMessages.height : 0)) {
+            if (eventPoint.position.y > topBar.height - (pinnedMessages.visible ? pinnedMessages.height : 0) - (widgets.visible ? widgets.height : 0)) {
                 eventPoint.accepted = true
                 return;
             }
@@ -307,11 +307,47 @@ Pane {
                     }
                 }
             }
+
+            ScrollView {
+                id: widgets
+
+                Layout.row: 3
+                Layout.column: 2
+                Layout.columnSpan: 3
+
+                Layout.fillWidth: true
+                Layout.preferredHeight: Math.min(contentHeight, Nheko.avatarSize * 1.5)
+
+                visible: !!room && room.widgetLinks.length > 0 && !Settings.hiddenWidgets.includes(roomId)
+                clip: true
+
+                palette: Nheko.colors
+                ScrollBar.horizontal.visible: false
+
+                ListView {
+
+                    spacing: Nheko.paddingSmall
+                    model: room ? room.widgetLinks : undefined
+                    delegate: MatrixText {
+                        required property var modelData
+
+                        color: Nheko.colors.text
+                        text: modelData
+                    }
+
+
+                    ScrollHelper {
+                        flickable: parent
+                        anchors.fill: parent
+                        enabled: !Settings.mobileMode
+                    }
+                }
+            }
         }
 
         CursorShape {
             anchors.fill: parent
-            anchors.bottomMargin: pinnedMessages.visible ? pinnedMessages.height : 0
+            anchors.bottomMargin: (pinnedMessages.visible ? pinnedMessages.height : 0) + (widgets.visible ? widgets.height : 0)
             cursorShape: Qt.PointingHandCursor
         }
     }