summary refs log tree commit diff
path: root/resources/qml/TimelineView.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2019-10-20 12:39:47 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2019-11-23 20:06:15 +0100
commitc37495fae29cd93b1b03e4e3689c604cc5312a18 (patch)
tree44a9fd5b0eb2c2d459ba122bd8cff739e358e4b7 /resources/qml/TimelineView.qml
parentAdd native themeing to QML (where possible) (diff)
downloadnheko-c37495fae29cd93b1b03e4e3689c604cc5312a18.tar.xz
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.
Diffstat (limited to 'resources/qml/TimelineView.qml')
-rw-r--r--resources/qml/TimelineView.qml46
1 files changed, 1 insertions, 45 deletions
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"