Expose Show properly to QML and expand ContentView
This adds a WIP ContentView for displaying a cover art oriented browser. The Show class was updated to expose the needed properties to QML correctly. This introducted the use of @pyqtSlot to expose functions to QML (as opposed to properties).
This commit is contained in:
@@ -1,42 +1,43 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import Ikinuki.Client 1.0
|
||||
|
||||
Rectangle {
|
||||
TabView {
|
||||
property var providers
|
||||
//default property int selectedElement: 0
|
||||
//property var max_elements: providers.length
|
||||
width: parent.width * 0.7
|
||||
height: parent.height
|
||||
color: "#22282A"
|
||||
Column {
|
||||
Row {
|
||||
height: parent.parent.height * 0.
|
||||
tabsVisible: false
|
||||
Repeater {
|
||||
model: providers
|
||||
Tab {
|
||||
Rectangle {
|
||||
color: "#22282A"
|
||||
Column {
|
||||
Row {
|
||||
Repeater {
|
||||
property var provider: modelData
|
||||
id: inProgressRepeater
|
||||
model: modelData.inProgress
|
||||
Column {
|
||||
id: showColumn
|
||||
property var show: inProgressRepeater.provider.getShow(modelData)
|
||||
Image {
|
||||
height: 200
|
||||
width: 100
|
||||
source: showColumn.show.poster
|
||||
}
|
||||
Text {
|
||||
text: showColumn.show.title
|
||||
}
|
||||
Text {
|
||||
text: showColumn.show.year
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// anchors.fill: parent
|
||||
// // header
|
||||
// SidebarHeader {}
|
||||
// Repeater {
|
||||
// model: providers
|
||||
// SidebarElement {
|
||||
// name: modelData.name
|
||||
// selected: (index == selectedElement) ? true : false
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
//function mod(n, m) {
|
||||
// return ((n % m) + m) % m;
|
||||
//}
|
||||
//Keys.onPressed: (event)=> {
|
||||
// // Handle scrolling
|
||||
// if (event.key == Qt.Key_Down) {
|
||||
// selectedElement = mod(selectedElement + 1, max_elements);
|
||||
// }
|
||||
// else if (event.key == Qt.Key_Up) {
|
||||
// selectedElement = mod(selectedElement - 1, max_elements);
|
||||
// }
|
||||
// event.accepted = true;
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user