summary refs log tree commit diff
path: root/resources/qml/RowDelegateChooser.qml
blob: bacd970ab882223176458b7de8cec9fad8af7b41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import QtQuick 2.6
import Qt.labs.qmlmodels 1.0
import com.github.nheko 1.0

import "./delegates"

DelegateChooser {
	//role: "type" //< not supported in our custom implementation, have to use roleValue
	width: chat.width
	roleValue: model.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 {
		TimelineRow { view: chat; Placeholder { id: kid } }
	}
}