2024-10-22 12:39:42 +00:00
|
|
|
import QtQuick 2.15
|
2022-04-14 08:26:46 +00:00
|
|
|
|
2022-03-07 22:59:38 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2022-05-23 11:35:51 +00:00
|
|
|
import StatusQ.Components 0.1
|
2022-04-14 08:26:46 +00:00
|
|
|
|
|
|
|
Item {
|
2022-03-07 22:59:38 +00:00
|
|
|
id: root
|
2022-04-14 08:26:46 +00:00
|
|
|
|
2022-07-04 20:09:08 +00:00
|
|
|
property bool compact: false
|
2022-09-27 21:26:26 +00:00
|
|
|
property bool oneRow
|
2024-10-22 12:39:42 +00:00
|
|
|
|
|
|
|
// emoji hash in form of an array of emojis
|
|
|
|
property var emojiHash: []
|
2022-04-14 08:26:46 +00:00
|
|
|
|
2022-07-04 20:09:08 +00:00
|
|
|
readonly property real size: compact ? 10 : 15
|
2022-04-14 08:26:46 +00:00
|
|
|
|
|
|
|
implicitHeight: positioner.implicitHeight
|
|
|
|
implicitWidth: positioner.implicitWidth
|
|
|
|
|
|
|
|
Grid {
|
|
|
|
id: positioner
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
rows: root.oneRow ? 1 : 2
|
|
|
|
columnSpacing: root.oneRow ? 4 : 2
|
2022-07-04 20:11:20 +00:00
|
|
|
rowSpacing: root.compact ? 4 : 6
|
2022-04-14 08:26:46 +00:00
|
|
|
|
|
|
|
Repeater {
|
2024-10-22 12:39:42 +00:00
|
|
|
model: root.emojiHash
|
2022-04-14 08:26:46 +00:00
|
|
|
|
2022-05-23 11:35:51 +00:00
|
|
|
StatusEmoji {
|
2022-04-14 08:26:46 +00:00
|
|
|
width: root.size
|
|
|
|
height: root.size
|
2022-05-23 11:35:51 +00:00
|
|
|
emojiId: StatusQUtils.Emoji.iconId(modelData)
|
2022-04-14 08:26:46 +00:00
|
|
|
}
|
2022-03-07 22:59:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|