Refactor ContentView and add section header
This commit is contained in:
@@ -13,42 +13,22 @@ TabView {
|
|||||||
Tab {
|
Tab {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "#22282A"
|
color: "#22282A"
|
||||||
Column {
|
Row {
|
||||||
Row {
|
Item {
|
||||||
spacing: 80
|
height: 10
|
||||||
Item{
|
width: 40
|
||||||
width: 0.1
|
}
|
||||||
height: 10
|
Column {
|
||||||
|
spacing: 20
|
||||||
|
ContentViewElement {
|
||||||
|
title: "In Progress"
|
||||||
|
provider: modelData
|
||||||
|
repeaterModel: modelData.inProgress
|
||||||
}
|
}
|
||||||
Repeater {
|
ContentViewElement {
|
||||||
property var provider: modelData
|
title: "Recently Added"
|
||||||
id: inProgressRepeater
|
provider: modelData
|
||||||
model: modelData.inProgress
|
repeaterModel: modelData.recentlyAdded
|
||||||
Column {
|
|
||||||
id: showColumn
|
|
||||||
property var show: inProgressRepeater.provider.getShow(modelData)
|
|
||||||
Image {
|
|
||||||
height: 300
|
|
||||||
width: 300 * 0.68
|
|
||||||
source: showColumn.show.poster
|
|
||||||
mipmap: true
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
Item {width: 1; height: 15}
|
|
||||||
Text {
|
|
||||||
text: showColumn.show.title
|
|
||||||
color: "white"
|
|
||||||
font.pointSize: 15
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
Item {width: 1; height: 5}
|
|
||||||
Text {
|
|
||||||
text: showColumn.show.year
|
|
||||||
color: "white"
|
|
||||||
font.pointSize: 15
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
import QtQuick 2.12
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
|
||||||
|
|
||||||
|
Column {
|
||||||
|
property var title
|
||||||
|
property var provider
|
||||||
|
property var repeaterModel
|
||||||
|
Item {
|
||||||
|
width: 10
|
||||||
|
height: 40
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: title
|
||||||
|
font.pointSize: 30
|
||||||
|
color: "white"
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
width: 10
|
||||||
|
height: 40
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
//spacing: 80
|
||||||
|
//Item{
|
||||||
|
// width: -10
|
||||||
|
// height: 10
|
||||||
|
//}
|
||||||
|
Repeater {
|
||||||
|
property var provider: modelData
|
||||||
|
//id: inProgressRepeater
|
||||||
|
model: repeaterModel
|
||||||
|
Row{
|
||||||
|
Item {
|
||||||
|
height: 10
|
||||||
|
width: 80
|
||||||
|
}
|
||||||
|
Column {
|
||||||
|
id: showColumn
|
||||||
|
//property var show: inProgressRepeater.provider.getShow(modelData)
|
||||||
|
property var show: provider.getShow(modelData)
|
||||||
|
Image {
|
||||||
|
height: 300
|
||||||
|
width: 300 * 0.68
|
||||||
|
source: showColumn.show.poster
|
||||||
|
mipmap: true
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
}
|
||||||
|
Item {width: 1; height: 15}
|
||||||
|
Text {
|
||||||
|
text: showColumn.show.title
|
||||||
|
color: "white"
|
||||||
|
font.pointSize: 14
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
}
|
||||||
|
Item {width: 1; height: 5}
|
||||||
|
Text {
|
||||||
|
text: showColumn.show.year
|
||||||
|
color: "white"
|
||||||
|
font.pointSize: 14
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user