From e0e5912b7047b5ef557139801651bf52bb94cd2c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 19 Jun 2023 20:08:10 +0200 Subject: [PATCH] Fix completer size --- resources/qml/Completer.qml | 2 +- src/timeline/TimelineViewManager.cpp | 2 +- src/timeline/TimelineViewManager.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/Completer.qml b/resources/qml/Completer.qml index 7b18951c..9aebfdf5 100644 --- a/resources/qml/Completer.qml +++ b/resources/qml/Completer.qml @@ -100,7 +100,7 @@ Control { // Broken, see https://bugreports.qt.io/browse/QTBUG-102811 //reuseItems: true - implicitWidth: listView.contentItem.childrenRect.width + implicitWidth: Math.max(listView.contentItem.childrenRect.width, 20) model: completer pixelAligned: true spacing: rowSpacing diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index 2f6553e5..b8bd679b 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -436,7 +436,7 @@ TimelineViewManager::focusMessageInput() emit focusInput(); } -QObject * +QAbstractItemModel * TimelineViewManager::completerFor(const QString &completerName, const QString &roomId) { if (completerName == QLatin1String("user")) { diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h index a4bc6c41..53179b44 100644 --- a/src/timeline/TimelineViewManager.h +++ b/src/timeline/TimelineViewManager.h @@ -134,8 +134,8 @@ public slots: void setVideoCallItem(); - QObject *completerFor(const QString &completerName, - const QString &roomId = QLatin1String(QLatin1String(""))); + QAbstractItemModel *completerFor(const QString &completerName, + const QString &roomId = QLatin1String(QLatin1String(""))); void forwardMessageToRoom(mtx::events::collections::TimelineEvents const *e, QString roomId); RoomlistModel *rooms() { return rooms_; }