Author: mir3x
Date: Sun Nov 27 14:11:32 2016
New Revision: 34640

URL: http://svn.gna.org/viewcvs/freeciv?rev=34640&view=rev
Log:
Qt client - fixed highlight status in unit action

See bug #25340

Modified:
    trunk/client/gui-qt/hudwidget.cpp
    trunk/client/gui-qt/hudwidget.h

Modified: trunk/client/gui-qt/hudwidget.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/hudwidget.cpp?rev=34640&r1=34639&r2=34640&view=diff
==============================================================================
--- trunk/client/gui-qt/hudwidget.cpp   (original)
+++ trunk/client/gui-qt/hudwidget.cpp   Sun Nov 27 14:11:32 2016
@@ -737,7 +737,8 @@
 hud_action::hud_action(QWidget *parent) : QWidget(parent)
 {
   connect(this, SIGNAL(left_clicked()), SLOT(on_clicked()));
-  setFocusPolicy(Qt::ClickFocus);
+  setFocusPolicy(Qt::StrongFocus);
+  setMouseTracking(true);
   focus = false;
   action_pixmap = nullptr;
 }
@@ -797,6 +798,14 @@
   }
 }
 
+/****************************************************************************
+  Mouse move event for hud_action, draw focus
+****************************************************************************/
+void hud_action::mouseMoveEvent(QMouseEvent *event)
+{
+  focus = true;
+  update();
+}
 /****************************************************************************
   Leave event for hud_action, used to get status of pixmap higlight
 ****************************************************************************/

Modified: trunk/client/gui-qt/hudwidget.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/hudwidget.h?rev=34640&r1=34639&r2=34640&view=diff
==============================================================================
--- trunk/client/gui-qt/hudwidget.h     (original)
+++ trunk/client/gui-qt/hudwidget.h     Sun Nov 27 14:11:32 2016
@@ -161,6 +161,7 @@
 protected:
   void paintEvent(QPaintEvent *event);
   void mousePressEvent(QMouseEvent *e);
+  void mouseMoveEvent(QMouseEvent *event);
   void leaveEvent(QEvent *event);
   void enterEvent(QEvent *event);
 private slots:


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

Reply via email to