forked from ghostfox/qyouradio
pretty minor case of suffering
This commit is contained in:
134
Main.qml
134
Main.qml
@@ -11,87 +11,87 @@ ApplicationWindow {
|
||||
height: 800
|
||||
title: qsTr("QYouVideo")
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
flags: Qt.Dialog
|
||||
modality: Qt.ApplicationModal
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
height: 43
|
||||
header: Rectangle {
|
||||
Layout.fillWidth: true
|
||||
height: 43
|
||||
|
||||
color: Colors.surface0
|
||||
color: Colors.surface0
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 3
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 3
|
||||
|
||||
Label {
|
||||
Layout.leftMargin: 5
|
||||
text: "QYouVideo"
|
||||
heading: "h1"
|
||||
}
|
||||
Label {
|
||||
Layout.leftMargin: 5
|
||||
text: "QYouVideo"
|
||||
heading: "h1"
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Button {
|
||||
visible: stack.currentItem.StackView.index > 0
|
||||
text: "Back"
|
||||
onClicked: stack.popCurrentItem()
|
||||
}
|
||||
|
||||
TabBar {
|
||||
id: tabbar
|
||||
spacing: 10
|
||||
Label {
|
||||
heading: "h2"
|
||||
text: stack.currentItem.StackView.index
|
||||
}
|
||||
|
||||
background: Item{}
|
||||
Label {
|
||||
heading: "h2"
|
||||
text: stack.depth
|
||||
}
|
||||
|
||||
TabButton {
|
||||
text: qsTr("Videos")
|
||||
outlined: true
|
||||
implicitWidth: 80
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("About")
|
||||
outlined: true
|
||||
implicitWidth: 80
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Upload")
|
||||
}
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Button {
|
||||
text: qsTr("Videos")
|
||||
outlined: true
|
||||
implicitWidth: 80
|
||||
onClicked: if (stack.currentItem.StackView.index > 0) stack.push(stackVideoList)
|
||||
}
|
||||
Button {
|
||||
text: qsTr("About")
|
||||
outlined: true
|
||||
implicitWidth: 80
|
||||
}
|
||||
Button {
|
||||
text: qsTr("Upload")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SwipeView {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.margins: 20
|
||||
StackView {
|
||||
id: stack
|
||||
|
||||
interactive: false
|
||||
currentIndex: tabbar.currentIndex
|
||||
anchors.fill: parent
|
||||
anchors.margins: 20
|
||||
|
||||
Loader {
|
||||
// active: tabbar.currentIndex == 0
|
||||
active: true
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
source: "ViewVideoList.qml"
|
||||
}
|
||||
Loader {
|
||||
// active: tabbar.currentIndex == 1
|
||||
active: true
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
source: "ViewAbout.qml"
|
||||
}
|
||||
Loader {
|
||||
// active: tabbar.currentIndex == 2
|
||||
active: true
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
sourceComponent: Label {
|
||||
heading: "h1"
|
||||
text: "No idea if I'll ever implement this so don't worry >w<"
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
initialItem: ViewVideoList {
|
||||
id: stackVideoList
|
||||
}
|
||||
|
||||
Component.onCompleted: contentItem.highlightMoveDuration = 160;
|
||||
function openVideo(id) {
|
||||
// if (stack.find((item, index) => {
|
||||
// // If found player instance
|
||||
// if (item.id == id) {
|
||||
// // stack.pop(index, StackView.Immediate);
|
||||
// stack.push(item)
|
||||
// return true;
|
||||
// }
|
||||
// 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);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user