From c94672118e762c631f8814f29597ad3ad2e9eeab Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 16:33:16 +0200 Subject: [PATCH] Toolbar return to contacts view when click to icon or label --- retroshare-qml-app/src/components/BtnIcon.qml | 3 ++- retroshare-qml-app/src/main-app.qml | 23 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/components/BtnIcon.qml b/retroshare-qml-app/src/components/BtnIcon.qml index 6ce4f9e99..1492b0f35 100644 --- a/retroshare-qml-app/src/components/BtnIcon.qml +++ b/retroshare-qml-app/src/components/BtnIcon.qml @@ -8,9 +8,10 @@ Item { signal released property var imgUrl: "" + property alias fillMode: image.fillMode Image { - + id: image anchors.fill: parent source: imgUrl diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index ca9a1c2df..44e42d289 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -65,6 +65,15 @@ ApplicationWindow property var searchBtnCb + function openMainPage () + { + if (stackView.currentItem.objectName != "contactsView" ) + { + stackView.push("qrc:/Contacts.qml") + } + + } + states: [ State @@ -103,10 +112,13 @@ ApplicationWindow Component { id: rsIcon - Image + BtnIcon { + height: imageLoader.height + width: imageLoader.height fillMode: Image.PreserveAspectFit - source: "icons/retroshare06.png" + imgUrl: "/icons/retroshare06.png" + onClicked:{ toolBar.openMainPage() } } } @@ -116,8 +128,13 @@ ApplicationWindow anchors.verticalCenter: parent.verticalCenter anchors.left: imageLoader.right anchors.leftMargin: 20 - } + MouseArea { + anchors.fill: parent + onClicked: { toolBar.openMainPage() } + } + + } BtnIcon {