]> git.sur5r.net Git - minitube/blobdiff - src/thlibrary/thblackbar.cpp
Imported Upstream version 1.2
[minitube] / src / thlibrary / thblackbar.cpp
index 0043fc57c54db995ab4910d62d21915382feae3d..4101be04650a7705d50b1547cfd48a466ca442b8 100644 (file)
@@ -4,6 +4,7 @@
 #include <QtGui>
 
 #include "thblackbar.h"
+#include "../fontutils.h"
 
 /* ============================================================================
  *  PRIVATE Class
@@ -66,8 +67,8 @@ QSize THBlackBar::minimumSizeHint (void) const {
  *  PROTECTED Methods
  */
 void THBlackBar::paintEvent (QPaintEvent *event) {
-    int height = event->rect().height();
-    int width = event->rect().width();
+    int height = rect().height();
+    int width = rect().width();
     // int mh = (height / 2);
 
     // THPainter p(this);
@@ -176,9 +177,7 @@ QAction *THBlackBar::hoveredAction (const QPoint& pos) const {
 }
 
 int THBlackBar::calculateButtonWidth (void) const {
-    QFont smallerBoldFont;
-    smallerBoldFont.setBold(true);
-    smallerBoldFont.setPointSize(smallerBoldFont.pointSize()*.85);
+    QFont smallerBoldFont = FontUtils::smallBold();
     QFontMetrics fontMetrics(smallerBoldFont);
     int tmpItemWidth, itemWidth = 0;
     foreach (QAction *action, d->actionList) {
@@ -245,11 +244,12 @@ void THBlackBar::drawButton (     QPainter *painter,
 
     painter->fillRect(0, 0, width, mh, QBrush(gradient));
     painter->fillRect(0, mh, width, mh, color);
+#ifdef APP_MAC
+    painter->drawRect(-1, -1, width+1, height);
+#else
     painter->drawRect(0, 0, width, height);
-
-    QFont smallerBoldFont;
-    smallerBoldFont.setBold(true);
-    smallerBoldFont.setPointSize(smallerBoldFont.pointSize()*.85);
+#endif
+    QFont smallerBoldFont = FontUtils::smallBold();
     painter->setFont(smallerBoldFont);
     painter->setPen(QPen(QColor(0xff, 0xff, 0xff), 1));
     painter->drawText(0, 1, width, height, Qt::AlignCenter, action->text());