2020-09-23 18:21:08 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
import "../helpers/channelList.js" as ChannelJSON
|
|
|
|
import "../controls"
|
2020-09-23 18:21:08 +00:00
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: sectionRepeater
|
|
|
|
model: ChannelJSON.categories
|
2021-10-01 15:58:36 +00:00
|
|
|
signal suggestedMessageClicked(string channel)
|
2020-09-23 18:21:08 +00:00
|
|
|
Item {
|
|
|
|
anchors.top: index === 0 ? parent.top : parent.children[index - 1].bottom
|
|
|
|
anchors.topMargin: index === 0 ? 0 : Style.current.padding
|
|
|
|
width: parent.width - Style.current.padding
|
2020-09-23 19:11:27 +00:00
|
|
|
height: childrenRect.height
|
2020-09-23 18:21:08 +00:00
|
|
|
|
2020-09-23 21:11:57 +00:00
|
|
|
StyledText {
|
2020-09-23 18:21:08 +00:00
|
|
|
id: sectionTitle
|
|
|
|
text: modelData.name
|
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: 16
|
|
|
|
}
|
|
|
|
Flow {
|
2022-08-03 14:04:01 +00:00
|
|
|
width: parent.width
|
2020-09-23 18:21:08 +00:00
|
|
|
anchors.top: sectionTitle.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
|
|
|
spacing: 10
|
|
|
|
Repeater {
|
|
|
|
model: modelData.channels
|
2021-10-01 15:58:36 +00:00
|
|
|
SuggestedChannel {
|
|
|
|
channel: modelData
|
|
|
|
onClicked: {
|
|
|
|
suggestedMessageClicked(channel);
|
|
|
|
}
|
|
|
|
}
|
2020-09-23 18:21:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|