From 65d85768d0fbdcfbfa273c1676d3649157af8589 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 27 Apr 2021 11:08:21 +0200 Subject: [PATCH] Clean up design a bit --- resources/qml/ForwardCompleter.qml | 26 ++++++++++++++------------ resources/qml/TimelineView.qml | 3 ++- resources/qml/TopBar.qml | 4 ++-- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/resources/qml/ForwardCompleter.qml b/resources/qml/ForwardCompleter.qml index f85362c1..6dbd8926 100644 --- a/resources/qml/ForwardCompleter.qml +++ b/resources/qml/ForwardCompleter.qml @@ -10,32 +10,30 @@ import im.nheko 1.0 Popup { id: forwardMessagePopup + property var mid + + function setMessageEventId(mid_in) { + mid = mid_in; + } + x: Math.round(parent.width / 2 - width / 2) y: Math.round(parent.height / 2 - height / 2) modal: true palette: colors parent: Overlay.overlay - - width: implicitWidth >= 300 ? implicitWidth : 300 + width: implicitWidth >= (timelineRoot.width * 0.8) ? implicitWidth : (timelineRoot.width * 0.8) height: implicitHeight + completerPopup.height + padding * 2 leftPadding: 10 rightPadding: 10 - - property var mid - + background: null onOpened: { completerPopup.open(); roomTextInput.forceActiveFocus(); } - onClosed: { completerPopup.close(); } - function setMessageEventId(mid_in) { - mid = mid_in; - } - Column { id: forwardColumn @@ -47,6 +45,7 @@ Popup { text: qsTr("Forward Message") font.bold: true bottomPadding: 10 + color: colors.text } Reply { @@ -78,6 +77,7 @@ Popup { } } } + } Completer { @@ -102,11 +102,13 @@ Popup { onCountChanged: { if (completerPopup.count > 0 && (completerPopup.currentIndex < 0 || completerPopup.currentIndex >= completerPopup.count)) completerPopup.currentIndex = 0; + } target: completerPopup } Overlay.modal: Rectangle { - color: "#aa1E1E1E" + color: Qt.rgba(colors.window.r, colors.window.g, colors.window.b, 0.75) } -} \ No newline at end of file + +} diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 7cf029e1..81ca7705 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -76,6 +76,7 @@ Page { ForwardCompleter { } + } Shortcut { @@ -133,7 +134,7 @@ Page { } Platform.MenuItem { - visible: messageContextMenu.eventType == MtxEvent.ImageMessage || messageContextMenu.eventType == MtxEvent.VideoMessage || messageContextMenu.eventType == MtxEvent.AudioMessage || messageContextMenu.eventType == MtxEvent.FileMessage || messageContextMenu.eventType == MtxEvent.Sticker || messageContextMenu.eventType == MtxEvent.TextMessage|| messageContextMenu.eventType == MtxEvent.LocationMessage || messageContextMenu.eventType == MtxEvent.EmoteMessage || messageContextMenu.eventType == MtxEvent.NoticeMessage + visible: messageContextMenu.eventType == MtxEvent.ImageMessage || messageContextMenu.eventType == MtxEvent.VideoMessage || messageContextMenu.eventType == MtxEvent.AudioMessage || messageContextMenu.eventType == MtxEvent.FileMessage || messageContextMenu.eventType == MtxEvent.Sticker || messageContextMenu.eventType == MtxEvent.TextMessage || messageContextMenu.eventType == MtxEvent.LocationMessage || messageContextMenu.eventType == MtxEvent.EmoteMessage || messageContextMenu.eventType == MtxEvent.NoticeMessage text: qsTr("Forward") onTriggered: { var forwardMess = forwardCompleterComponent.createObject(timelineRoot); diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml index f5c5c84a..858652c2 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml @@ -72,8 +72,8 @@ Rectangle { font.pointSize: fontMetrics.font.pointSize * 1.1 text: room ? room.roomName : qsTr("No room selected") maximumLineCount: 1 - elide: Text.ElideRight - textFormat: Text.RichText + elide: Text.ElideRight + textFormat: Text.RichText } MatrixText {