better and better

This commit is contained in:
Dark Steveneq
2025-10-20 02:53:30 +02:00
parent c168086601
commit 5ac6248c66
8 changed files with 114 additions and 125 deletions

View File

@@ -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}));
// }
}
}