Author: mir3x
Date: Tue Nov 29 12:56:29 2016
New Revision: 34653

URL: http://svn.gna.org/viewcvs/freeciv?rev=34653&view=rev
Log:
Qt client - use notify font for sidebar

See patch #8032

Modified:
    trunk/client/gui-qt/sidebar.cpp
    trunk/client/gui-qt/sidebar.h

Modified: trunk/client/gui-qt/sidebar.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/sidebar.cpp?rev=34653&r1=34652&r2=34653&view=diff
==============================================================================
--- trunk/client/gui-qt/sidebar.cpp     (original)
+++ trunk/client/gui-qt/sidebar.cpp     Tue Nov 29 12:56:29 2016
@@ -63,7 +63,7 @@
   def_pixmap = pix;
   scaled_pixmap = new QPixmap;
   final_pixmap = new QPixmap;
-  sfont = new QFont;
+  sfont = new QFont(*fc_font::instance()->get_font(fonts::notify_label));
   left_click = func;
   desc = label;
   standard = type;
@@ -76,6 +76,16 @@
   timer = new QTimer;
   timer->setSingleShot(false);
   timer->setInterval(700);
+  sfont->setCapitalization(QFont::SmallCaps);
+  sfont->setItalic(true);
+  info_font = new  QFont(*sfont);
+  info_font->setBold(true);
+  if (sfont->pointSize() < 0) {
+    info_font->setPixelSize(sfont->pixelSize() + 2);
+  } else  {
+    info_font->setPointSize(sfont->pointSize() + 2);
+  }
+  info_font->setItalic(false);
   connect(timer, SIGNAL(timeout()), this, SLOT(sblink()));
 }
 
@@ -96,6 +106,8 @@
     delete final_pixmap;
   }
   delete timer;
+  delete sfont;
+  delete info_font;
 }
 
 /***************************************************************************
@@ -372,9 +384,6 @@
   }
 
   p.begin(final_pixmap);
-  sfont->setPixelSize(16);
-  sfont->setCapitalization(QFont::SmallCaps);
-  sfont->setItalic(true);
   p.setFont(*sfont);
   pen.setColor(QColor(232, 255, 0));
   p.setPen(pen);
@@ -436,10 +445,8 @@
   }
 
   p.setPen(palette().color(QPalette::Text));
-
   if (custom_label.isEmpty() == false) {
-    sfont->setItalic(false);
-    p.setFont(*sfont);
+    p.setFont(*info_font);
     p.drawText(0, 0, width(), height(), Qt::AlignLeft | Qt::TextWordWrap,
                custom_label);
   }

Modified: trunk/client/gui-qt/sidebar.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/sidebar.h?rev=34653&r1=34652&r2=34653&view=diff
==============================================================================
--- trunk/client/gui-qt/sidebar.h       (original)
+++ trunk/client/gui-qt/sidebar.h       Tue Nov 29 12:56:29 2016
@@ -88,6 +88,7 @@
   pfcn wheel_up;
   pfcn_bool left_click;
   QFont *sfont;
+  QFont *info_font;
   QPixmap *def_pixmap;
   QPixmap *final_pixmap;
   QPixmap *scaled_pixmap;


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

Reply via email to