mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Prevent multiple instances of the same page on the StackView and stub out GamepadMapper
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Item {
|
||||||
|
objectName: "Gamepad Mapping"
|
||||||
|
}
|
||||||
+1
-1
@@ -144,7 +144,7 @@ GridView {
|
|||||||
var component = Qt.createComponent("AppView.qml")
|
var component = Qt.createComponent("AppView.qml")
|
||||||
var appView = component.createObject(stackView)
|
var appView = component.createObject(stackView)
|
||||||
appView.computerIndex = index
|
appView.computerIndex = index
|
||||||
appView.objectName = "Apps on " + model.name
|
appView.objectName = model.name
|
||||||
stackView.push(appView)
|
stackView.push(appView)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
+38
-11
@@ -15,6 +15,22 @@ ApplicationWindow {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function navigateTo(url, objectName)
|
||||||
|
{
|
||||||
|
var existingItem = stackView.find(function(item, index) {
|
||||||
|
return item.objectName === objectName
|
||||||
|
})
|
||||||
|
|
||||||
|
if (existingItem !== null) {
|
||||||
|
// Pop to the existing item
|
||||||
|
stackView.pop(existingItem)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Create a new item
|
||||||
|
stackView.push(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
header: ToolBar {
|
header: ToolBar {
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
@@ -45,17 +61,6 @@ ApplicationWindow {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolButton {
|
|
||||||
icon.source: "qrc:/res/settings.png"
|
|
||||||
onClicked: stackView.push("qrc:/gui/SettingsView.qml")
|
|
||||||
|
|
||||||
Menu {
|
|
||||||
id: optionsMenu
|
|
||||||
x: parent.width
|
|
||||||
transformOrigin: Menu.TopRight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ToolButton {
|
ToolButton {
|
||||||
icon.source: "qrc:/res/question_mark.png"
|
icon.source: "qrc:/res/question_mark.png"
|
||||||
|
|
||||||
@@ -68,6 +73,28 @@ ApplicationWindow {
|
|||||||
transformOrigin: Menu.TopRight
|
transformOrigin: Menu.TopRight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ToolButton {
|
||||||
|
icon.source: "qrc:/res/ic_videogame_asset_white_48px.svg"
|
||||||
|
onClicked: navigateTo("qrc:/gui/GamepadMapper.qml", "Gamepad Mapping")
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
id: gamepadMappingMenu
|
||||||
|
x: parent.width
|
||||||
|
transformOrigin: Menu.TopRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ToolButton {
|
||||||
|
icon.source: "qrc:/res/settings.png"
|
||||||
|
onClicked: navigateTo("qrc:/gui/SettingsView.qml", "Settings")
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
id: optionsMenu
|
||||||
|
x: parent.width
|
||||||
|
transformOrigin: Menu.TopRight
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,6 @@
|
|||||||
<file>gui/AppView.qml</file>
|
<file>gui/AppView.qml</file>
|
||||||
<file>gui/SettingsView.qml</file>
|
<file>gui/SettingsView.qml</file>
|
||||||
<file>gui/StreamSegue.qml</file>
|
<file>gui/StreamSegue.qml</file>
|
||||||
|
<file>gui/GamepadMapper.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
Reference in New Issue
Block a user