mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Add navigation toolbar (#1)
* Add preferences view skeleton * Add toolbar & help button * Add working back button * Title of page in toolbar * Remove unused imports * Make comments better! * Remove unused drawer element * Remove superfluous > 1 check * Use point size font instead of pixel size * Add AppView page title
This commit is contained in:
committed by
Cameron Gutman
parent
1bfec3a032
commit
b630c07653
@@ -17,6 +17,7 @@ GridView {
|
|||||||
anchors.bottomMargin: 5
|
anchors.bottomMargin: 5
|
||||||
cellWidth: 350; cellHeight: 350;
|
cellWidth: 350; cellHeight: 350;
|
||||||
focus: true
|
focus: true
|
||||||
|
objectName: "Computers"
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// Start polling when this view is shown
|
// Start polling when this view is shown
|
||||||
@@ -135,6 +136,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
|
||||||
stackView.push(appView)
|
stackView.push(appView)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import QtQuick 2.9
|
||||||
|
Rectangle {
|
||||||
|
id: settingsPage
|
||||||
|
color: "#333333"
|
||||||
|
objectName: "Settings"
|
||||||
|
|
||||||
|
// TODO - add settings
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import QtQuick 2.9
|
import QtQuick 2.9
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls 2.2
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
ApplicationWindow {
|
ApplicationWindow {
|
||||||
id: window
|
id: window
|
||||||
@@ -13,4 +14,60 @@ ApplicationWindow {
|
|||||||
initialItem: "PcView.qml"
|
initialItem: "PcView.qml"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header: ToolBar {
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
spacing: 20
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
ToolButton {
|
||||||
|
// Only make the button visible if the user has navigated somewhere.
|
||||||
|
visible: stackView.depth > 1
|
||||||
|
|
||||||
|
icon.source: "qrc:/res/arrow_left.png"
|
||||||
|
onClicked: stackView.pop()
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
id: backButton
|
||||||
|
x: parent.width - width
|
||||||
|
transformOrigin: Menu.TopRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: titleLabel
|
||||||
|
text: stackView.currentItem.objectName
|
||||||
|
font.pointSize: 15
|
||||||
|
elide: Label.ElideRight
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
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 {
|
||||||
|
icon.source: "qrc:/res/question_mark.png"
|
||||||
|
|
||||||
|
// TODO need to make sure browser is brought to foreground.
|
||||||
|
onClicked: Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Setup-Guide");
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
id: helpButton
|
||||||
|
x: parent.width
|
||||||
|
transformOrigin: Menu.TopRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,6 @@
|
|||||||
<file>gui/ic_tv_white_48px.svg</file>
|
<file>gui/ic_tv_white_48px.svg</file>
|
||||||
<file>gui/ic_add_to_queue_white_48px.svg</file>
|
<file>gui/ic_add_to_queue_white_48px.svg</file>
|
||||||
<file>gui/AppView.qml</file>
|
<file>gui/AppView.qml</file>
|
||||||
|
<file>gui/SettingsView.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 507 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -5,5 +5,8 @@
|
|||||||
<file>res/ic_remove_from_queue_white_48px.svg</file>
|
<file>res/ic_remove_from_queue_white_48px.svg</file>
|
||||||
<file>res/ic_videogame_asset_white_48px.svg</file>
|
<file>res/ic_videogame_asset_white_48px.svg</file>
|
||||||
<file>res/no_app_image.png</file>
|
<file>res/no_app_image.png</file>
|
||||||
|
<file>res/settings.png</file>
|
||||||
|
<file>res/question_mark.png</file>
|
||||||
|
<file>res/arrow_left.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
Reference in New Issue
Block a user