Author: mir3x
Date: Sun Oct 23 20:05:48 2016
New Revision: 34227

URL: http://svn.gna.org/viewcvs/freeciv?rev=34227&view=rev
Log:
Qt client - use custom close/minimize/buttons for no titlebar mode

See patch #7856

Added:
    trunk/data/themes/gui-qt/icons/cclose.png   (with props)
    trunk/data/themes/gui-qt/icons/cmax.png   (with props)
    trunk/data/themes/gui-qt/icons/cmin.png   (with props)
Modified:
    trunk/client/gui-qt/fc_client.cpp
    trunk/data/themes/gui-qt/icons/Makefile.am

Modified: trunk/client/gui-qt/fc_client.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/fc_client.cpp?rev=34227&r1=34226&r2=34227&view=diff
==============================================================================
--- trunk/client/gui-qt/fc_client.cpp   (original)
+++ trunk/client/gui-qt/fc_client.cpp   Sun Oct 23 20:05:48 2016
@@ -728,18 +728,26 @@
 {
   QHBoxLayout *hb;
   QPushButton *qpb;
+  int h;
+  QFont *f = fc_font::instance()->get_font(fonts::default_font);
+
+  if (f->pointSize() > 0) {
+    h = f->pointSize();
+  } else {
+    h = f->pixelSize();
+  }
   mw = qmw;
   hb = new QHBoxLayout();
-  qpb = new QPushButton(style()->standardIcon(
-                                 QStyle::SP_TitleBarMinButton), "");
+  qpb = new QPushButton(fc_icons::instance()->get_icon("cmin"), "");
+  qpb->setFixedSize(h, h);
   connect(qpb, SIGNAL(clicked()), SLOT(minimize()));
   hb->addWidget(qpb);
-  qpb = new QPushButton(style()->standardIcon(
-                                 QStyle::SP_TitleBarMaxButton), "");
+  qpb = new QPushButton(fc_icons::instance()->get_icon("cmax"), "");
+  qpb->setFixedSize(h, h);
   connect(qpb, SIGNAL(clicked()), SLOT(maximize()));
   hb->addWidget(qpb);
-  qpb = new QPushButton(style()->standardIcon(
-                                 QStyle::SP_TitleBarCloseButton), "");
+  qpb = new QPushButton(fc_icons::instance()->get_icon("cclose"), "");
+  qpb->setFixedSize(h, h);
   connect(qpb, SIGNAL(clicked()), SLOT(close_fc()));
   hb->addWidget(qpb);
   setLayout(hb);

Modified: trunk/data/themes/gui-qt/icons/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/themes/gui-qt/icons/Makefile.am?rev=34227&r1=34226&r2=34227&view=diff
==============================================================================
--- trunk/data/themes/gui-qt/icons/Makefile.am  (original)
+++ trunk/data/themes/gui-qt/icons/Makefile.am  Sun Oct 23 20:05:48 2016
@@ -7,6 +7,9 @@
        ai.png                  \
        building.png            \
        buildroad.png           \
+       cclose.png              \
+       cmax.png                \
+       cmin.png                \
        chopchop.png            \
        cities.png              \
        city-close.png          \

Added: trunk/data/themes/gui-qt/icons/cclose.png
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/themes/gui-qt/icons/cclose.png?rev=34227&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/data/themes/gui-qt/icons/cclose.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: trunk/data/themes/gui-qt/icons/cmax.png
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/themes/gui-qt/icons/cmax.png?rev=34227&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/data/themes/gui-qt/icons/cmax.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: trunk/data/themes/gui-qt/icons/cmin.png
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/themes/gui-qt/icons/cmin.png?rev=34227&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/data/themes/gui-qt/icons/cmin.png
------------------------------------------------------------------------------
    svn:mime-type = image/png


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

Reply via email to