From c37495fae29cd93b1b03e4e3689c604cc5312a18 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 20 Oct 2019 12:39:47 +0200 Subject: Use a basic implementation of a DelegateChooser for compat with older Qt The interface is taken from Qt/KDE, but the implementation is different, because the Qt implementation depends on some Qt internals. --- resources/qml/TimelineView.qml | 46 +----------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) (limited to 'resources/qml/TimelineView.qml') diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index d1ada3ea..e09b9ed3 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -3,7 +3,6 @@ import QtQuick.Controls 2.1 import QtQuick.Layouts 1.2 import QtGraphicalEffects 1.0 import QtQuick.Window 2.2 -import Qt.labs.qmlmodels 1.0 import com.github.nheko 1.0 @@ -91,50 +90,7 @@ Rectangle { onMovementEnded: updatePosition() spacing: 4 - delegate: DelegateChooser { - role: "type" - DelegateChoice { - roleValue: MtxEvent.TextMessage - TimelineRow { view: chat; TextMessage { id: kid } } - } - DelegateChoice { - roleValue: MtxEvent.NoticeMessage - TimelineRow { view: chat; NoticeMessage { id: kid } } - } - DelegateChoice { - roleValue: MtxEvent.EmoteMessage - TimelineRow { view: chat; TextMessage { id: kid } } - } - DelegateChoice { - roleValue: MtxEvent.ImageMessage - TimelineRow { view: chat; ImageMessage { id: kid } } - } - DelegateChoice { - roleValue: MtxEvent.Sticker - TimelineRow { view: chat; ImageMessage { id: kid } } - } - DelegateChoice { - roleValue: MtxEvent.FileMessage - TimelineRow { view: chat; FileMessage { id: kid } } - } - DelegateChoice { - roleValue: MtxEvent.VideoMessage - TimelineRow { view: chat; PlayableMediaMessage { id: kid } } - } - DelegateChoice { - roleValue: MtxEvent.AudioMessage - TimelineRow { view: chat; PlayableMediaMessage { id: kid } } - } - DelegateChoice { - roleValue: MtxEvent.Redacted - TimelineRow { view: chat; Redacted { id: kid } } - } - DelegateChoice { - //roleValue: MtxEvent.Redacted - TimelineRow { view: chat; Placeholder { id: kid } } - } - } - + delegate: RowDelegateChooser {} section { property: "section" -- cgit 1.5.1