forked from ghostfox/qyouradio
better and better
This commit is contained in:
32
Main.qml
32
Main.qml
@@ -24,27 +24,21 @@ ApplicationWindow {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 3
|
||||
|
||||
Label {
|
||||
Layout.leftMargin: 5
|
||||
text: "QYouVideo"
|
||||
heading: "h1"
|
||||
}
|
||||
|
||||
Button {
|
||||
visible: stack.currentItem.StackView.index > 0
|
||||
// visible: stack.depth > 1
|
||||
text: "Back"
|
||||
onClicked: stack.popCurrentItem()
|
||||
}
|
||||
|
||||
Label {
|
||||
heading: "h2"
|
||||
text: stack.currentItem.StackView.index
|
||||
id: logo
|
||||
// visible: stack.currentItem.StackView.index == 0
|
||||
Layout.leftMargin: 5
|
||||
text: "QYouVideo"
|
||||
heading: "h1"
|
||||
clip: true
|
||||
}
|
||||
|
||||
Label {
|
||||
heading: "h2"
|
||||
text: stack.depth
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
@@ -54,12 +48,13 @@ ApplicationWindow {
|
||||
text: qsTr("Videos")
|
||||
outlined: true
|
||||
implicitWidth: 80
|
||||
onClicked: if (stack.currentItem.StackView.index > 0) stack.push(stackVideoList)
|
||||
onClicked: if (!(stack.currentItem instanceof ViewVideoList)) stack.push(ComponentCache.viewVideoList.createObject(stack))
|
||||
}
|
||||
Button {
|
||||
text: qsTr("About")
|
||||
outlined: true
|
||||
implicitWidth: 80
|
||||
onClicked: if (!(stack.currentItem instanceof ViewAbout)) stack.push(ComponentCache.viewAbout.createObject(stack))
|
||||
}
|
||||
Button {
|
||||
text: qsTr("Upload")
|
||||
@@ -69,13 +64,12 @@ ApplicationWindow {
|
||||
|
||||
StackView {
|
||||
id: stack
|
||||
// __wheelAreaScrollSpeed: 50
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: 20
|
||||
|
||||
initialItem: ViewVideoList {
|
||||
id: stackVideoList
|
||||
}
|
||||
initialItem: ViewVideoList {}
|
||||
|
||||
function openVideo(id) {
|
||||
// if (stack.find((item, index) => {
|
||||
@@ -88,9 +82,7 @@ ApplicationWindow {
|
||||
// return false;
|
||||
// }) == null) {
|
||||
// If didn't find player instance
|
||||
const component = Qt.createComponent("VideoPlayer.qml");
|
||||
const item = component.createObject(stack, {id: id})
|
||||
stack.push(item);
|
||||
stack.push(ComponentCache.videoPlayer.createObject(stack, {id: id}));
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user