Author: mir3x
Date: Wed Jan 11 19:16:18 2017
New Revision: 34811

URL: http://svn.gna.org/viewcvs/freeciv?rev=34811&view=rev
Log:
Qt client - fix keyboard goto

See bug #25419


Modified:
    branches/S2_6/client/gui-qt/mapctrl.cpp
    branches/S2_6/client/gui-qt/mapview.cpp
    branches/S2_6/client/gui-qt/mapview.h
    branches/S2_6/client/gui-qt/menu.cpp

Modified: branches/S2_6/client/gui-qt/mapctrl.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/mapctrl.cpp?rev=34811&r1=34810&r2=34811&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/mapctrl.cpp     (original)
+++ branches/S2_6/client/gui-qt/mapctrl.cpp     Wed Jan 11 19:16:18 2017
@@ -385,7 +385,9 @@
   }
   sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
   if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
-    action_button_pressed(pos.x(), pos.y(), SELECT_FOCUS);
+    if (goto_is_active() == false && pcity == nullptr) {
+      action_button_pressed(pos.x(), pos.y(), SELECT_FOCUS);
+    }
     return;
   }
 
@@ -422,11 +424,14 @@
 
   sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
   if (bt == sc->mouse && md == sc->mod) {
-    if (keyboardless_goto_active) {
-      release_goto_button(pos.x(), pos.y());
-    } else {
+    if (menu_click == true) {
+      menu_click = false;
+      return;
+    }
+    if (keyboardless_goto_active == false || goto_is_active() == true) {
       action_button_pressed(pos.x(), pos.y(), SELECT_POPUP);
     }
+    release_goto_button(pos.x(), pos.y());
     return;
   }
 }

Modified: branches/S2_6/client/gui-qt/mapview.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/mapview.cpp?rev=34811&r1=34810&r2=34811&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/mapview.cpp     (original)
+++ branches/S2_6/client/gui-qt/mapview.cpp     Wed Jan 11 19:16:18 2017
@@ -174,6 +174,7 @@
 **************************************************************************/
 map_view::map_view() : QWidget()
 {
+  menu_click = false;
   cursor = -1;
   QTimer *timer = new QTimer(this);
   setAttribute(Qt::WA_OpaquePaintEvent, true);

Modified: branches/S2_6/client/gui-qt/mapview.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/mapview.h?rev=34811&r1=34810&r2=34811&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/mapview.h       (original)
+++ branches/S2_6/client/gui-qt/mapview.h       Wed Jan 11 19:16:18 2017
@@ -90,6 +90,7 @@
   void resume_searching(int pos_x,int pos_y,int &w, int &h,
                         int wdtht, int hght, int recursive_nr);
   void update_cursor(enum cursor_type);
+  bool menu_click;
 
 protected:
   void paintEvent(QPaintEvent *event);

Modified: branches/S2_6/client/gui-qt/menu.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/menu.cpp?rev=34811&r1=34810&r2=34811&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/menu.cpp        (original)
+++ branches/S2_6/client/gui-qt/menu.cpp        Wed Jan 11 19:16:18 2017
@@ -1461,6 +1461,7 @@
   fc_shortcut *fcs;
 
   if (sid == SC_GOTO) {
+    gui()->mapview_wdg->menu_click = true;
     slot_unit_goto();
     return;
   }


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to