summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-04-04 13:21:56 +0000
committerakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-04-04 13:21:56 +0000
commitf9b0edf1c3797b3e378a19965699b1d0e1815385 (patch)
tree0331920c684cf4c21fc4be9c9116b0708a6ab9dc
parentd351fb848ddc75529ad3a88f6034c75a081cd0a8 (diff)
downloadnavit-svn-f9b0edf1c3797b3e378a19965699b1d0e1815385.tar.gz
Add:gui/qml:Added more zooming options
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@3128 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--gui/qml/navitProxy.h3
-rw-r--r--gui/qml/skins/navit/PageNavigation.qml7
-rw-r--r--gui/qml/skins/navit/PageSettingsRules.qml5
3 files changed, 12 insertions, 3 deletions
diff --git a/gui/qml/navitProxy.h b/gui/qml/navitProxy.h
index e9f77f37..935264bc 100644
--- a/gui/qml/navitProxy.h
+++ b/gui/qml/navitProxy.h
@@ -119,6 +119,9 @@ public slots:
void setCenter() {
navit_set_center(this->object->nav,this->object->currentPoint->pc(),1);
}
+ void zoomToRoute() {
+ navit_zoom_to_route(this->object->nav,-1);
+ }
protected:
int getAttrFunc(enum attr_type type, struct attr* attr, struct attr_iter* iter) { return navit_get_attr(this->object->nav, type, attr, iter); }
int setAttrFunc(struct attr* attr) {return navit_set_attr(this->object->nav,attr); }
diff --git a/gui/qml/skins/navit/PageNavigation.qml b/gui/qml/skins/navit/PageNavigation.qml
index 1d0e878b..20331ccc 100644
--- a/gui/qml/skins/navit/PageNavigation.qml
+++ b/gui/qml/skins/navit/PageNavigation.qml
@@ -31,7 +31,7 @@ Rectangle {
anchors.bottom: parent.verticalCenter; anchors.bottomMargin: gui.height/16;
spacing: gui.width/12
ButtonIcon {
- id: btnView; text: "View position\non map"; icon: "gui_maps.svg"; onClicked: { navit.getPosition();navit.setCenter();gui.backToMap(); }
+ id: btnRouteview; text: "View route"; icon: "gui_town.svg"; onClicked: { navit.zoomToRoute(), gui.backToMap(); }
}
ButtonIcon {
id: btnRoadbook; text: "Roadbook"; icon: "gui_log.svg"; onClicked: console.log("Implement me!");
@@ -42,11 +42,14 @@ Rectangle {
}
Grid {
- columns: 2;rows: 1
+ columns: 3;rows: 1
anchors.horizontalCenter: parent.horizontalCenter;
anchors.top: parent.verticalCenter; anchors.topMargin: gui.height/16;
spacing: gui.width/12
ButtonIcon {
+ id: btnView; text: "View position\non map"; icon: "gui_maps.svg"; onClicked: { navit.getPosition();navit.setCenter();gui.backToMap(); }
+ }
+ ButtonIcon {
id: btnPoi; text: "POIs near\nPosition"; icon: "attraction.svg"; onClicked: gui.setPage("PagePoi.qml");
opacity: 0;
}
diff --git a/gui/qml/skins/navit/PageSettingsRules.qml b/gui/qml/skins/navit/PageSettingsRules.qml
index 4460a941..8c6da328 100644
--- a/gui/qml/skins/navit/PageSettingsRules.qml
+++ b/gui/qml/skins/navit/PageSettingsRules.qml
@@ -19,7 +19,7 @@ Rectangle {
}
Grid {
- columns: 1; rows: 3
+ columns: 1; rows: 4
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: parent.verticalCenter;
spacing: gui.width/12
@@ -32,6 +32,9 @@ Rectangle {
ToggleSwitch {
id: followrcursorSw; stOn: navit.getAttr("follow_cursor"); text: "Map follows Vehicle"; onChanged: navit.setAttr("follow_cursor",followrcursorSw.stOn)
}
+ ToggleSwitch {
+ id: autozoomSw; stOn: navit.getAttr("autozoom_active"); text: "Auto zoom"; onChanged: navit.setAttr("autozoom_active",autozoomSw.stOn)
+ }
}
Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }