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:
Michelle Bergeron
2018-07-07 22:15:02 -07:00
committed by Cameron Gutman
parent 1bfec3a032
commit b630c07653
8 changed files with 71 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ GridView {
anchors.bottomMargin: 5
cellWidth: 350; cellHeight: 350;
focus: true
objectName: "Computers"
Component.onCompleted: {
// Start polling when this view is shown
@@ -135,6 +136,7 @@ GridView {
var component = Qt.createComponent("AppView.qml")
var appView = component.createObject(stackView)
appView.computerIndex = index
appView.objectName = "Apps on " + model.name
stackView.push(appView)
}
else {

8
app/gui/SettingsView.qml Normal file
View File

@@ -0,0 +1,8 @@
import QtQuick 2.9
Rectangle {
id: settingsPage
color: "#333333"
objectName: "Settings"
// TODO - add settings
}

View File

@@ -1,5 +1,6 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
ApplicationWindow {
id: window
@@ -13,4 +14,60 @@ ApplicationWindow {
initialItem: "PcView.qml"
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
}
}
}
}
}

View File

@@ -6,5 +6,6 @@
<file>gui/ic_tv_white_48px.svg</file>
<file>gui/ic_add_to_queue_white_48px.svg</file>
<file>gui/AppView.qml</file>
<file>gui/SettingsView.qml</file>
</qresource>
</RCC>

BIN
app/res/arrow_left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

BIN
app/res/question_mark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
app/res/settings.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -5,5 +5,8 @@
<file>res/ic_remove_from_queue_white_48px.svg</file>
<file>res/ic_videogame_asset_white_48px.svg</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>
</RCC>