Author: mir3x Date: Wed Oct 28 10:21:51 2015 New Revision: 30260 URL: http://svn.gna.org/viewcvs/freeciv?rev=30260&view=rev Log: Added changing cursor to resize when hovered over edge chat and messages.
See patch #6474 Modified: branches/S2_5/client/gui-qt/chatline.cpp branches/S2_5/client/gui-qt/messagewin.cpp Modified: branches/S2_5/client/gui-qt/chatline.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-qt/chatline.cpp?rev=30260&r1=30259&r2=30260&view=diff ============================================================================== --- branches/S2_5/client/gui-qt/chatline.cpp (original) +++ branches/S2_5/client/gui-qt/chatline.cpp Wed Oct 28 10:21:51 2015 @@ -88,6 +88,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: branches/S2_5/client/gui-qt/messagewin.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-qt/messagewin.cpp?rev=30260&r1=30259&r2=30260&view=diff ============================================================================== --- branches/S2_5/client/gui-qt/messagewin.cpp (original) +++ branches/S2_5/client/gui-qt/messagewin.cpp Wed Oct 28 10:21:51 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