Author: mir3x
Date: Wed Jan 11 19:16:43 2017
New Revision: 34812
URL: http://svn.gna.org/viewcvs/freeciv?rev=34812&view=rev
Log:
Qt client - fix keyboard goto
See bug #25419
Modified:
branches/S3_0/client/gui-qt/mapctrl.cpp
branches/S3_0/client/gui-qt/mapview.cpp
branches/S3_0/client/gui-qt/mapview.h
branches/S3_0/client/gui-qt/menu.cpp
Modified: branches/S3_0/client/gui-qt/mapctrl.cpp
URL:
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-qt/mapctrl.cpp?rev=34812&r1=34811&r2=34812&view=diff
==============================================================================
--- branches/S3_0/client/gui-qt/mapctrl.cpp (original)
+++ branches/S3_0/client/gui-qt/mapctrl.cpp Wed Jan 11 19:16:43 2017
@@ -387,7 +387,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;
}
@@ -424,11 +426,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/S3_0/client/gui-qt/mapview.cpp
URL:
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-qt/mapview.cpp?rev=34812&r1=34811&r2=34812&view=diff
==============================================================================
--- branches/S3_0/client/gui-qt/mapview.cpp (original)
+++ branches/S3_0/client/gui-qt/mapview.cpp Wed Jan 11 19:16:43 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/S3_0/client/gui-qt/mapview.h
URL:
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-qt/mapview.h?rev=34812&r1=34811&r2=34812&view=diff
==============================================================================
--- branches/S3_0/client/gui-qt/mapview.h (original)
+++ branches/S3_0/client/gui-qt/mapview.h Wed Jan 11 19:16:43 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/S3_0/client/gui-qt/menu.cpp
URL:
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-qt/menu.cpp?rev=34812&r1=34811&r2=34812&view=diff
==============================================================================
--- branches/S3_0/client/gui-qt/menu.cpp (original)
+++ branches/S3_0/client/gui-qt/menu.cpp Wed Jan 11 19:16:43 2017
@@ -1644,6 +1644,7 @@
fc_shortcut *fcs;
if (sid == SC_GOTO) {
+ gui()->mapview_wdg->menu_click = true;
slot_unit_goto();
return;
}
_______________________________________________
Freeciv-commits mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-commits