Author: mir3x
Date: Tue Nov 22 20:42:52 2016
New Revision: 34613

URL: http://svn.gna.org/viewcvs/freeciv?rev=34613&view=rev
Log:
Qt client - allow scrolling map using shift+cursors

See patch #8015


Modified:
    branches/S2_6/client/gui-qt/mapctrl.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=34613&r1=34612&r2=34613&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/mapctrl.cpp     (original)
+++ branches/S2_6/client/gui-qt/mapctrl.cpp     Tue Nov 22 20:42:52 2016
@@ -125,19 +125,37 @@
     switch (event->key()) {
     case Qt::Key_Up:
     case Qt::Key_8:
-      key_unit_move(DIR8_NORTH);
+      if (is_shift) {
+        recenter_button_pressed(gui()->mapview_wdg->width() / 2, 0);
+      } else {
+        key_unit_move(DIR8_NORTH);
+      }
       return;
     case Qt::Key_Left:
     case Qt::Key_4:
-      key_unit_move(DIR8_WEST);
+      if (is_shift) {
+        recenter_button_pressed(0, gui()->mapview_wdg->height() / 2);
+      } else {
+        key_unit_move(DIR8_WEST);
+      }
       return;
     case Qt::Key_Right:
     case Qt::Key_6:
-      key_unit_move(DIR8_EAST);
+      if (is_shift) {
+        recenter_button_pressed(gui()->mapview_wdg->width(),
+                                gui()->mapview_wdg->height() / 2);
+      } else {
+        key_unit_move(DIR8_EAST);
+      }
       return;
     case Qt::Key_Down:
     case Qt::Key_2:
-      key_unit_move(DIR8_SOUTH);
+      if (is_shift) {
+        recenter_button_pressed(gui()->mapview_wdg->width() / 2,
+                                gui()->mapview_wdg->height());
+      } else {
+        key_unit_move(DIR8_SOUTH);
+      }
       return;
     case Qt::Key_PageUp:
     case Qt::Key_9:


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

Reply via email to