From 3c4623a3fd3c112c63aa089182f73000d10856c7 Mon Sep 17 00:00:00 2001 From: mir3x Date: Wed, 25 Jan 2017 21:31:34 +0000 Subject: [PATCH] Qt client - Fixed unit autocentering when left clicking something outside active unit visible screen. See bug #25466 git-svn-id: svn://svn.gna.org/svn/freeciv/branches/S2_6@34891 a0f10bec-cc02-0410-94fc-a9cfff90b4cd --- client/gui-qt/mapctrl.cpp | 3 +++ client/gui-qt/mapview.h | 1 + 2 files changed, 4 insertions(+) diff --git a/client/gui-qt/mapctrl.cpp b/client/gui-qt/mapctrl.cpp index 0c7919f3d5..dc3c2be2a7 100644 --- a/client/gui-qt/mapctrl.cpp +++ b/client/gui-qt/mapctrl.cpp @@ -386,6 +386,8 @@ void map_view::shortcut_pressed(int key) sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON); if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) { if (goto_is_active() == false) { + stored_autocenter = gui_options.auto_center_on_unit; + gui_options.auto_center_on_unit = false; action_button_pressed(pos.x(), pos.y(), SELECT_FOCUS); } return; @@ -430,6 +432,7 @@ void map_view::shortcut_released(Qt::MouseButton bt) } if (keyboardless_goto_active == false || goto_is_active() == true) { action_button_pressed(pos.x(), pos.y(), SELECT_POPUP); + gui_options.auto_center_on_unit = stored_autocenter; } release_goto_button(pos.x(), pos.y()); return; diff --git a/client/gui-qt/mapview.h b/client/gui-qt/mapview.h index cb89e75c5b..429ee7cd6a 100644 --- a/client/gui-qt/mapview.h +++ b/client/gui-qt/mapview.h @@ -102,6 +102,7 @@ private slots: private: void update_font(const QString &name, const QFont &font); + bool stored_autocenter; int cursor_frame; int cursor; -- 2.11.4.GIT