Author: mir3x
Date: Wed Oct 28 10:22:18 2015
New Revision: 30262

URL: http://svn.gna.org/viewcvs/freeciv?rev=30262&view=rev
Log:
Added changing cursor to resize when hovered over edge chat and messages.

See patch #6474


Modified:
    trunk/client/gui-qt/chatline.cpp
    trunk/client/gui-qt/messagewin.cpp

Modified: trunk/client/gui-qt/chatline.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/chatline.cpp?rev=30262&r1=30261&r2=30262&view=diff
==============================================================================
--- trunk/client/gui-qt/chatline.cpp    (original)
+++ trunk/client/gui-qt/chatline.cpp    Wed Oct 28 10:22:18 2015
@@ -87,6 +87,7 @@
   connect(chat_line, SIGNAL(returnPressed()), this, SLOT(send()));
   connect(remove_links, SIGNAL(clicked()), this, SLOT(rm_links()));
   connect(cb, SIGNAL(stateChanged(int)), this, SLOT(state_changed(int)));
+  setMouseTracking(true);
 }
 
 /***************************************************************************

Modified: trunk/client/gui-qt/messagewin.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/messagewin.cpp?rev=30262&r1=30261&r2=30262&view=diff
==============================================================================
--- trunk/client/gui-qt/messagewin.cpp  (original)
+++ trunk/client/gui-qt/messagewin.cpp  Wed Oct 28 10:22:18 2015
@@ -73,6 +73,7 @@
   resy = false;
   chat_stretch = 5;
   msg_stretch = 5;
+  setMouseTracking(true);
 }
 
 /***************************************************************************
@@ -103,10 +104,10 @@
 {
   if (event->button() == Qt::LeftButton) {
     cursor = event->globalPos() - geometry().topLeft();
-    if (event->y() > 0 && event->y() < 20){
+    if (event->y() > 0 && event->y() < 5){
       resize_mode = true;
       resy = true;
-    } else if (event->x() > width() - 20 && event->x() < width()){
+    } else if (event->x() > width() - 5 && event->x() < width()){
       resize_mode = true;
       resx = true;
     }
@@ -128,7 +129,8 @@
 }
 
 /**************************************************************************
-  Called when mouse button was pressed. Used to moving info_tab.
+  Called when mouse moved (mouse track is enabled).
+  Used to resizing info_tab.
 **************************************************************************/
 void info_tab::mouseMoveEvent(QMouseEvent *event)
 {
@@ -141,7 +143,14 @@
     resize(event->x(), height());
     move(0, gui()->mapview_wdg->height() - height());
     setCursor(Qt::SizeHorCursor);
-  }
+  } else if (event->x() > width() - 5 && event->x() < width()) {
+    setCursor(Qt::SizeHorCursor);
+  } else if (event->y() > 0 && event->y() < 5) {
+    setCursor(Qt::SizeVerCursor);
+  } else {
+    setCursor(Qt::ArrowCursor);
+  }
+  event->setAccepted(true);
 }
 
 /***************************************************************************
@@ -353,6 +362,7 @@
                                   const QItemSelection &)),
           SLOT(item_selected(const QItemSelection &,
                              const QItemSelection &)));
+  setMouseTracking(true);
 }
 
 /***************************************************************************


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

Reply via email to