Refactor Show display to remove extra elements

This commit is contained in:
2022-08-30 21:29:53 -04:00
parent 9938167092
commit 1d8d00a7f2
2 changed files with 96 additions and 110 deletions
@@ -25,13 +25,9 @@ Column {
Repeater { Repeater {
property var provider: modelData property var provider: modelData
model: repeaterModel model: repeaterModel
Item {
height: 300
width: 350 * 0.68
ContentViewElementShow { ContentViewElementShow {
show: provider.getShow(modelData) show: provider.getShow(modelData)
} }
} }
} }
} }
}
+22 -32
View File
@@ -2,26 +2,29 @@ import QtQuick 2.12
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtGraphicalEffects 1.12 import QtGraphicalEffects 1.12
Column {
property var show
anchors.fill: parent
Item { Item {
id: parentElem property var show
property int baseHeight: 300 property int baseHeight: 350
property int childHeight: baseHeight property int childHeight: baseHeight
property int childWidth: baseHeight * 0.68 property int childWidth: baseHeight * 0.68
property int childHeightExpanded: baseHeight + 50 property int childHeightExpanded: baseHeight * 15 / 14
property int childWidthExpanded: (baseHeight + 50) * 0.68 property int childWidthExpanded: (baseHeight * 15 / 14) * 0.68
property int borderWidth: 3 property int borderWidth: 3
property int borderRadius: 1 property int borderRadius: 1
property int borderRectHeight: childHeight + (borderWidth * 2) property int borderRectHeight: childHeight + (borderWidth * 2)
property int borderRectWidth: childWidth + (borderWidth * 2) property int borderRectWidth: childWidth + (borderWidth * 2)
property int borderRectHeightExpanded: childHeightExpanded + (borderWidth * 2) property int borderRectHeightExpanded: childHeightExpanded + (borderWidth * 2)
property int borderRectWidthExpanded: childWidthExpanded + (borderWidth * 2) property int borderRectWidthExpanded: childWidthExpanded + (borderWidth * 2)
height: 300 + (borderWidth * 2)
width: (300 * 0.68) + (borderWidth * 2) height: baseHeight
width: (baseHeight * 8 / 7) * 0.68
Column {
anchors.fill: parent
Item {
id: parentElem
state: (elemSelected && (index == xIndex)) ? "selected" : "deselected" state: (elemSelected && (index == xIndex)) ? "selected" : "deselected"
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.fill: parent
DropShadow { DropShadow {
id: dropShadow id: dropShadow
anchors.fill: img anchors.fill: img
@@ -52,8 +55,8 @@ Column {
PropertyChanges { PropertyChanges {
target: rect target: rect
border.width: 0 border.width: 0
height: parent.borderRectHeight height: borderRectHeight
width: parent.borderRectWidth width: borderRectWidth
} }
PropertyChanges { PropertyChanges {
target: dropShadow target: dropShadow
@@ -61,17 +64,17 @@ Column {
} }
PropertyChanges { PropertyChanges {
target: img target: img
width: parent.childWidth width: childWidth
height: parent.childHeight height: childHeight
} }
}, },
State { State {
name: "selected" name: "selected"
PropertyChanges { PropertyChanges {
target: rect target: rect
border.width: parent.borderWidth border.width: borderWidth
height: parent.borderRectHeightExpanded height: borderRectHeightExpanded
width: parent.borderRectWidthExpanded width: borderRectWidthExpanded
} }
PropertyChanges { PropertyChanges {
target: dropShadow target: dropShadow
@@ -79,8 +82,8 @@ Column {
} }
PropertyChanges { PropertyChanges {
target: img target: img
width: parent.childWidthExpanded width: childWidthExpanded
height: parent.childHeightExpanded height: childHeightExpanded
} }
} }
] ]
@@ -95,18 +98,5 @@ Column {
] ]
} }
//Item {width: 1; height: 15} }
//Text {
// text: show.title
// color: "white"
// font.pointSize: 14
// anchors.horizontalCenter: parent.horizontalCenter
//}
//Item {width: 1; height: 5}
//Text {
// text: show.year
// color: "white"
// font.pointSize: 14
// anchors.horizontalCenter: parent.horizontalCenter
//}
} }