X-Git-Url: https://git.sur5r.net/?p=minitube;a=blobdiff_plain;f=src%2Fthlibrary%2Fthblackbar.cpp;h=4101be04650a7705d50b1547cfd48a466ca442b8;hp=0043fc57c54db995ab4910d62d21915382feae3d;hb=7b529d6a918efe39ca6d63201fcdb954a3c881b4;hpb=efec77e73c8eafb7ba1f0b7817567272f02262e5 diff --git a/src/thlibrary/thblackbar.cpp b/src/thlibrary/thblackbar.cpp index 0043fc5..4101be0 100644 --- a/src/thlibrary/thblackbar.cpp +++ b/src/thlibrary/thblackbar.cpp @@ -4,6 +4,7 @@ #include #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());