From 7f83ff0eb70289ed2e2b7be64d3965f2aed74981 Mon Sep 17 00:00:00 2001 From: akashihi Date: Fri, 9 Apr 2010 12:53:56 +0000 Subject: [PATCH] Fix:gui/qml:Made point.qml available after swithing to main.qml git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3144 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/gui/qml/guiProxy.h | 4 +++- navit/navit/gui/qml/skins/navit/Cellar.qml | 30 +++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/navit/navit/gui/qml/guiProxy.h b/navit/navit/gui/qml/guiProxy.h index ae172f4..57f6cdd 100644 --- a/navit/navit/gui/qml/guiProxy.h +++ b/navit/navit/gui/qml/guiProxy.h @@ -101,7 +101,9 @@ public slots: returnPage=returnList.takeLast(); //Set previous element as return page and remove it from the list } this->source=returnList.join(QString("/")); - this->source.prepend(QString("/")); + if (!this->source.startsWith("/")) { + this->source.prepend(QString("/")); + } this->setPage(returnPage); } diff --git a/navit/navit/gui/qml/skins/navit/Cellar.qml b/navit/navit/gui/qml/skins/navit/Cellar.qml index 129a608..2df59cb 100644 --- a/navit/navit/gui/qml/skins/navit/Cellar.qml +++ b/navit/navit/gui/qml/skins/navit/Cellar.qml @@ -2,17 +2,20 @@ import Qt 4.6 Rectangle { - function hideButtons() { - if ( gui.returnSource.split('/').length < 4 ) { - btnBack.opacity=0; + function onStartup() { + console.log("returnSource: "+gui.returnSource); + if ( gui.returnSource.split('/').length > 2 ) { + btnBack.opacity=1; } - if ( gui.returnSource == "/main.qml" ) { - btnHome.opacity=0; - btnBack.opacity=0; + if ( gui.returnSource != "/point.qml" ) { + btnPoint.opacity=1 + } + if ( gui.returnSource != "/main.qml" ) { + btnMenu.opacity=1; } } - Component.onCompleted: hideButtons(); + Component.onCompleted: onStartup(); ButtonIcon { id: btnMap; icon: "gui_map.svg"; text:"Map"; onClicked: gui.backToMap(); @@ -21,15 +24,24 @@ Rectangle { } ButtonIcon { - id: btnHome; icon: "gui_home.svg"; text: "Home"; onClicked: { gui.returnSource=""; gui.setPage("main.qml"); } - anchors.horizontalCenter: parent.horizontalCenter; anchors.leftMargin: 3 + id: btnPoint; icon: "gui_arrow_up.svg"; text: "Point"; onClicked: { gui.returnSource=""; gui.setPage("point.qml"); } + anchors.left: btnMap.left; anchors.leftMargin: parent.width/3; + anchors.bottom: parent.bottom; anchors.bottomMargin: 3 + opacity: 0; + } + + ButtonIcon { + id: btnMenu; icon: "gui_menu.svg"; text: "Menu"; onClicked: { gui.returnSource=""; gui.setPage("main.qml"); } + anchors.right: btnBack.right; anchors.rightMargin: parent.width/3; anchors.bottom: parent.bottom; anchors.bottomMargin: 3 + opacity: 0; } ButtonIcon { id: btnBack; icon: "gui_arrow_left.svg"; text: "Back"; onClicked: gui.backToPrevPage(); anchors.right: parent.right; anchors.leftMargin: 3 anchors.bottom: parent.bottom; anchors.bottomMargin: 3 + opacity: 0; } } -- 2.7.4