summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-04-09 12:53:56 +0000
committerakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-04-09 12:53:56 +0000
commit90401f3daad5ba283bd33f994f77d9548c7fad17 (patch)
tree22b28b5b184426400daf08fe6f9d3a024f8cf758
parentc8223620e6e25d53fadaea00b75a088752e57b5c (diff)
downloadnavit-svn-90401f3daad5ba283bd33f994f77d9548c7fad17.tar.gz
Fix:gui/qml:Made point.qml available after swithing to main.qml
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@3144 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--gui/qml/guiProxy.h4
-rw-r--r--gui/qml/skins/navit/Cellar.qml30
2 files changed, 24 insertions, 10 deletions
diff --git a/gui/qml/guiProxy.h b/gui/qml/guiProxy.h
index ae172f48..57f6cdda 100644
--- a/gui/qml/guiProxy.h
+++ b/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/gui/qml/skins/navit/Cellar.qml b/gui/qml/skins/navit/Cellar.qml
index 129a6088..2df59cb5 100644
--- a/gui/qml/skins/navit/Cellar.qml
+++ b/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;
}
}