Author: mir3x
Date: Sun Nov  1 18:53:07 2015
New Revision: 30352

URL: http://svn.gna.org/viewcvs/freeciv?rev=30352&view=rev
Log:
Shows scrollbars in city production, and only when needed - in Qt-client.

See patch #6504


Modified:
    trunk/client/gui-qt/citydlg.cpp

Modified: trunk/client/gui-qt/citydlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/citydlg.cpp?rev=30352&r1=30351&r2=30352&view=diff
==============================================================================
--- trunk/client/gui-qt/citydlg.cpp     (original)
+++ trunk/client/gui-qt/citydlg.cpp     Sun Nov  1 18:53:07 2015
@@ -2926,8 +2926,20 @@
                              const QItemSelection &)));
   resizeRowsToContents();
   resizeColumnsToContents();
-  setFixedWidth(3 * sh.x() + 5);
-  setFixedHeight(list_model->rowCount()*sh.y() + 5);
+  setFixedWidth(3 * sh.x() + 6);
+  setFixedHeight(list_model->rowCount()*sh.y() + 6);
+  if (width() > desk_width) {
+    setFixedWidth(desk_width);
+    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
+  } else {
+    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+  }
+  if (height() > desk_height) {
+    setFixedHeight(desk_height);
+    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
+  } else {
+    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+  }
 
   pos = QCursor::pos();
   if (pos.x() + width() > desk_width) {


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

Reply via email to