on xenial help sign in
Fix GridView interactive problem.
aadff5bYing-Chun Liu
Dash/Movie/MoviePreview.qml+9−5
@@ -78,14 +78,19 @@ DashPreview {
78 id: buttons
78 id: buttons
79 objectName: "gridButtons"
79 objectName: "gridButtons"
80 model: root.previewData.actions
80 model: root.previewData.actions
81+ interactive: false
81
82
83+ anchors.left: parent.left
84+ anchors.right: parent.right
85+
82− property int numOfRows: (count + 1) / 2
86+ property int numOfRows: (count + numOfColumns - 1) / numOfColumns
87+ property int numOfColumns: Math.max(1, Math.floor(width / (buttonWidth + spacing)))
83 property int spacing: units.gu(1)
88 property int spacing: units.gu(1)
84 height: Math.max(units.gu(4), units.gu(4)*numOfRows + spacing*(numOfRows - 1))
89 height: Math.max(units.gu(4), units.gu(4)*numOfRows + spacing*(numOfRows - 1))
85
90
86− cellWidth: Math.max(units.gu(9), width / 2)
91+ cellWidth: width / buttons.numOfColumns
87− cellHeight: buttonHeight + spacing
92+ cellHeight: buttonHeight + buttons.spacing
88− property int buttonWidth: Math.max(0, width / 2 - spacing)
93+ property int buttonWidth: units.gu(17) - spacing
89 property int buttonHeight: units.gu(4)
94 property int buttonHeight: units.gu(4)
90
95
91 delegate: Button {
96 delegate: Button {
@@ -160,7 +165,6 @@ DashPreview {
160 var parts = []
165 var parts = []
161 if (ready) {
166 if (ready) {
162 if (previewData.year) parts.push(previewData.year)
167 if (previewData.year) parts.push(previewData.year)
163− //if (nfo.video.runtime) parts.push("%1 minutes".arg(nfo.video.runtime))
164 }
168 }
165 return parts.join(", ");
169 return parts.join(", ");
166 }
170 }