From b630c07653456403c6b739dbe5b33dd19b2ebce4 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Sat, 7 Jul 2018 22:15:02 -0700 Subject: [PATCH] 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 --- app/gui/PcView.qml | 2 ++ app/gui/SettingsView.qml | 8 ++++++ app/gui/main.qml | 57 ++++++++++++++++++++++++++++++++++++++ app/qml.qrc | 1 + app/res/arrow_left.png | Bin 0 -> 507 bytes app/res/question_mark.png | Bin 0 -> 1109 bytes app/res/settings.png | Bin 0 -> 1056 bytes app/resources.qrc | 3 ++ 8 files changed, 71 insertions(+) create mode 100644 app/gui/SettingsView.qml create mode 100644 app/res/arrow_left.png create mode 100644 app/res/question_mark.png create mode 100644 app/res/settings.png diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index 84bf4635..5ed167e5 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -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 { diff --git a/app/gui/SettingsView.qml b/app/gui/SettingsView.qml new file mode 100644 index 00000000..5f54ed42 --- /dev/null +++ b/app/gui/SettingsView.qml @@ -0,0 +1,8 @@ +import QtQuick 2.9 +Rectangle { + id: settingsPage + color: "#333333" + objectName: "Settings" + + // TODO - add settings +} diff --git a/app/gui/main.qml b/app/gui/main.qml index d02127e9..9c5d2e88 100644 --- a/app/gui/main.qml +++ b/app/gui/main.qml @@ -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 + } + } + } + } } diff --git a/app/qml.qrc b/app/qml.qrc index 08f52b4c..83a8c65a 100644 --- a/app/qml.qrc +++ b/app/qml.qrc @@ -6,5 +6,6 @@ gui/ic_tv_white_48px.svg gui/ic_add_to_queue_white_48px.svg gui/AppView.qml + gui/SettingsView.qml diff --git a/app/res/arrow_left.png b/app/res/arrow_left.png new file mode 100644 index 0000000000000000000000000000000000000000..6454cbd25afac882c06441e42b202ba3cdeec6b3 GIT binary patch literal 507 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)pVryh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6Mi^+1ZVz$3C4NPB>>+sSM@AY+fGi(^Q}y|*(A`3@NfuzY{p-=nXlxcl2pCI9ms z&FwY~)(wvzT|TXxQ2z7K$;nRy-m3lF;t}_0()2&|r=!=}oO;~2f5FXFkIzSH1nq0P zmDqQ2(OJf{Zwv*D25zVGlJ*@re@OM+^Nou-bTpK>yG}GIZCcR5R(Ai)+B1GX&5P&j z{B!vyetUXH-SyW_9E!UVnB3kpt?0OA#t-y|YKdz^NlIc#s#S7PDv)9@GBC8zH89sT zum~|Qu`)KcGPKY(Ft9Q(*lssv8H$G7{FKbJO57TbCF@85HE4irC@xF4N=htF)h#W` wWJt@*Nww0~*DuK}(9caw&rHtNO)X4{C^5~53ab=M1nOb%boFyt=akR{0Di==5dZ)H literal 0 HcmV?d00001 diff --git a/app/res/question_mark.png b/app/res/question_mark.png new file mode 100644 index 0000000000000000000000000000000000000000..a701cb8814e7b46c9cad0ec49e8a7d9b2f780f23 GIT binary patch literal 1109 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)pVryh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6Mi^+1ZVz$3C4NPB>>+sSM@1_ov^PZ!6KjC*fqp7#!Q6gj^C@oI(B9X=js zT3J+Yp4$|=V71uWMNLiDJX^QEk>Bv`rv8$$cW>BdtaVx#>Y;Z@OqAv0mL?xP}egCD^*f=LlyrR4^JZSq8KhL$3 z%%1!1^RCi=xpYaU=j2JtdJOHeU)f&Zi(!1md0eJIGGle?2eAiY8zwpJ=oWoobsi9?NSVOO&yPeA)9s`CF#@V03!}sNy zUFiIj&h-Dh8v7S!Uez5&2O|H}|I2>bWiP6*&%9x~{(;UCdo#0;Uv9IFHGiD1EYhE# zb|mTX9{#jD=h=22=w&+n^R?WD+Z#_Z=xcq_e9HR6@1w(^-JZtVr#v{~dfu+6WzCHn zUk->@&n)MbfpkXt^V z?}59*`8DTxwz$dtO!aKDH&DwoM^lGnt}t$_*4mzYm7yAo9@r#-1mGWp(4ej#zAYilPYdC+B+`5@w63Nq4=IUqPd9deU1p!MEsB_; z-*xx)AK2K%Sw1J@n4HTKC64oq;Tsco?_#*MfxYym$f3;#6jJ3r9koi!ouF&=_2e|W zZzsf#bM;3)SKT|!w^Lok_xhh1Tl=j3G5%rt!Kku*ZQzp(U{+Brag8WRNi0dVN-jzT zQVd20h8DU8=DG$JAqFN^Mn+a9X4(b@Rt5%*YeN%JH00)|WTsW(*6`uO+q*yw8Xy~r z%hIiq5{pxHON%lY(lT>Wt@QQvOL7bJa}(1ule2XVy#kUP!^7Od47_Ip^)Pt4`njxg HN@xNA@M6*w literal 0 HcmV?d00001 diff --git a/app/res/settings.png b/app/res/settings.png new file mode 100644 index 0000000000000000000000000000000000000000..235a319d0a12d3cc564396798b029fe5d9039309 GIT binary patch literal 1056 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)pVryh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6Mi^+1ZVz$3C4NPB>>+sSM@1_q{wo-U3d8Ta1KJnt2XK5>4qr1+PZ3m!ixO|W33fEVpT5s2}HTC_L?-Ukz0IQ=3;>>YG=h3O_dS}o51=j z)9~|xw#wr4cV|9p?$NiY*i-zxdf)w-*3a)%&%5Fx>?^{Sz-7KnYVGD}Kaw?%gkKB{ zxo68-Wf8c1mKB)>|=OyJ~=@_@#lP*Lz@eDRWi4* zd~{bm>#enV;}6A`OJ>&gajWe;^1ZyF!c)srYNcpTEtA9cC6S`hOFt!e2hE>()`fX1 zOW#|CkD+suU9=L`Fh1C{q}X!OT2HA-S9D(n{IJx`wCMTysAoy{xj+Z`4G$xI=P@p2 zc_(D>@Z?^`FUvM@ePQU9d!);{y>dnbOO=tW{sP$IR*@fDsoOzS(#;odj zU$`x2#!W|Y|69kM18jBcu>Ru${2Bz8ROC}&#i z(9OP`rG(*fsn+7u2i{)qGB=eOa)dozI)!u9428c=-)xk>3tgD*y61gZ5>rO$ou6wS zt?sz%b>!@NGtYg;cg&u2j+tL&Z$N>qU>u1syH{LMHN?WgLo3-Ut{RacTJzJ{zzQ(3)6B1vu zbHdD)6)06n)%9-^i*9t>v|a4IK;&Ldv7KHsvM26Yd$h-Geu}||9V_;@Zu1j+Wm0yV zr)I_F8_OEEWSkJu5_$7%f8^|pr0I|J>-%Rd%W6y70ZjF(C9V-ADTyViR>?)FK#IZ0 zz|cb1z+BhBBE-Ph%GlJ(z+BtFz{res/ic_remove_from_queue_white_48px.svg res/ic_videogame_asset_white_48px.svg res/no_app_image.png + res/settings.png + res/question_mark.png + res/arrow_left.png