Author: mir3x
Date: Sun Nov  1 18:53:01 2015
New Revision: 30351

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

See patch #6504


Modified:
    branches/S2_6/client/gui-qt/citydlg.cpp

Modified: branches/S2_6/client/gui-qt/citydlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/citydlg.cpp?rev=30351&r1=30350&r2=30351&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/citydlg.cpp     (original)
+++ branches/S2_6/client/gui-qt/citydlg.cpp     Sun Nov  1 18:53:01 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