From 144e7cd038dee3b1dd1cce740a6debb16fa2b797 Mon Sep 17 00:00:00 2001 From: Malte E Date: Fri, 18 Feb 2022 21:06:28 +0100 Subject: [PATCH 1/3] make search usable on mobile --- resources/qml/QuickSwitcher.qml | 2 +- resources/qml/RoomList.qml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/resources/qml/QuickSwitcher.qml b/resources/qml/QuickSwitcher.qml index 8747c47d..3b8ceb15 100644 --- a/resources/qml/QuickSwitcher.qml +++ b/resources/qml/QuickSwitcher.qml @@ -13,7 +13,7 @@ Popup { property int textHeight: Math.round(Qt.application.font.pixelSize * 2.4) background: null - width: Math.round(parent.width / 2) + width: Math.min(Math.max(Math.round(parent.width / 2),450),parent.width) // limiting width to parent.width/2 can be a bit narrow x: Math.round(parent.width / 2 - width / 2) y: Math.round(parent.height / 4 - height / 2) modal: true diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml index da205950..b1d09eb1 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml @@ -673,6 +673,24 @@ Page { } } + ImageButton { + visible: !collapsed + Layout.fillWidth: true + hoverEnabled: true + ripple: false + width: 22 + height: 22 + image: ":/icons/icons/ui/search.svg" + ToolTip.visible: hovered + ToolTip.delay: Nheko.tooltipDelay + ToolTip.text: qsTr("Search rooms (Ctrl+K)") + Layout.margins: Nheko.paddingMedium + onClicked: { + var quickSwitch = quickSwitcherComponent.createObject(timelineRoot); + quickSwitch.open(); + } + } + ImageButton { visible: !collapsed Layout.fillWidth: true From a3fcb4d9909973902536ee866db4a4cce422e39a Mon Sep 17 00:00:00 2001 From: Malte E Date: Fri, 18 Feb 2022 21:29:14 +0100 Subject: [PATCH 2/3] fix awkward message spacing --- resources/qml/TimelineRow.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml index cc081679..8849545f 100644 --- a/resources/qml/TimelineRow.qml +++ b/resources/qml/TimelineRow.qml @@ -48,7 +48,7 @@ Item { property bool hovered: false width: parent.width - height: childrenRect.height + height: row.height+(reactionRow > 0 ? reactionRow.height-2 : 0 ) Rectangle { color: (Settings.messageHoverHighlight && hovered) ? Nheko.colors.alternateBase : "transparent" From c405eddea6d5ee8cad4ba31e06ec79af9630fc38 Mon Sep 17 00:00:00 2001 From: Malte E Date: Fri, 18 Feb 2022 21:33:09 +0100 Subject: [PATCH 3/3] actually fix awkward message spacing --- resources/qml/TimelineRow.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml index 8849545f..0ff33bf8 100644 --- a/resources/qml/TimelineRow.qml +++ b/resources/qml/TimelineRow.qml @@ -48,7 +48,7 @@ Item { property bool hovered: false width: parent.width - height: row.height+(reactionRow > 0 ? reactionRow.height-2 : 0 ) + height: row.height+(reactionRow.height > 0 ? reactionRow.height-2 : 0 ) Rectangle { color: (Settings.messageHoverHighlight && hovered) ? Nheko.colors.alternateBase : "transparent"