From 090a63dba96e9cedb22d0112cf5374cd11a3d2f1 Mon Sep 17 00:00:00 2001 From: Libor Pechacek Date: Tue, 2 Jan 2018 09:32:37 +0100 Subject: [PATCH] Mobile UI: Add direct skip to 1:1 and 1:2 zoom level Implemented as a menu of Zoom Out button. --- src/gui/map/map_editor.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gui/map/map_editor.cpp b/src/gui/map/map_editor.cpp index eac56a0a2..a5921a8fd 100644 --- a/src/gui/map/map_editor.cpp +++ b/src/gui/map/map_editor.cpp @@ -1364,6 +1364,17 @@ void MapEditorController::createMobileGUI() bottom_action_bar->addAction(pan_act, 1, col++); bottom_action_bar->addAction(zoom_out_act, 0, col); + auto zoom_out_button = bottom_action_bar->getButtonForAction(zoom_out_act); + auto mobile_zoom_out_menu = new QMenu(zoom_out_button); + auto base_scale_action = mobile_zoom_out_menu->addAction(tr("Base scale")); + connect(base_scale_action, &QAction::triggered, [this]() { + main_view->setZoom(1); + }); + auto mapping_scale_action = mobile_zoom_out_menu->addAction(tr("Mapping scale")); + connect(mapping_scale_action, &QAction::triggered, [this]() { + main_view->setZoom(2); + }); + zoom_out_button->setMenu(mobile_zoom_out_menu); bottom_action_bar->addAction(move_to_gps_pos_act, 1, col++);