]> git.sur5r.net Git - minitube/commitdiff
Use FontUtils everywhere
author <> <>
Sun, 1 Aug 2010 12:50:38 +0000 (14:50 +0200)
committerFlavio <flavio@guodil.local>
Sun, 1 Aug 2010 12:50:38 +0000 (14:50 +0200)
minitube.pro
src/AboutView.cpp
src/SearchView.cpp
src/playlist/PrettyItemDelegate.cpp
src/thlibrary/thblackbar.cpp

index de883f84adc7fcb749658954b307103a432482a1..0c00ef22dd5fbe6df8592b85f4215d3b8660ebac 100755 (executable)
@@ -11,7 +11,6 @@ QT += network \
     xml \
     phonon
 include(src/qtsingleapplication/qtsingleapplication.pri)
-include(src/thlibrary/thlibrary.pri)
 HEADERS += src/MainWindow.h \
     src/SearchView.h \
     src/MediaView.h \
@@ -41,7 +40,8 @@ HEADERS += src/MainWindow.h \
     src/videowidget.h \
     src/flickcharm.h \
     src/videodefinition.h \
-    src/fontutils.h
+    src/fontutils.h \
+    src/thlibrary/thblackbar.h
 SOURCES += src/main.cpp \
     src/MainWindow.cpp \
     src/SearchView.cpp \
@@ -70,7 +70,8 @@ SOURCES += src/main.cpp \
     src/flickcharm.cpp \
     src/videodefinition.cpp \
     src/constants.cpp \
-    src/fontutils.cpp
+    src/fontutils.cpp \
+    src/thlibrary/thblackbar.cpp
 RESOURCES += resources.qrc
 DESTDIR = build/target/
 OBJECTS_DIR = build/obj/
index 7abcb1dbf8c5b9c1f84c8f284e80672b56a66443..42477becb6d937910ef77ce5a04f5264520d9cc7 100644 (file)
@@ -5,6 +5,7 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
 
     QBoxLayout *aboutlayout = new QHBoxLayout(this);
     aboutlayout->setAlignment(Qt::AlignCenter);
+    aboutlayout->setMargin(30);
     aboutlayout->setSpacing(30);
 
     QLabel *logo = new QLabel(this);
index c56bd971c85614bb0ee82ba46d0cbdb9d6753c3a..99efdb67c7f86a79084cc961b111e5a4e9996e6c 100644 (file)
@@ -1,5 +1,6 @@
 #include "SearchView.h"
 #include "constants.h"
+#include "fontutils.h"
 
 namespace The {
     QMap<QString, QAction*>* globalActions();
@@ -10,12 +11,8 @@ static const int PADDING = 30;
 
 SearchView::SearchView(QWidget *parent) : QWidget(parent) {
 
-    QFont biggerFont;
-    biggerFont.setPointSize(biggerFont.pointSize()*1.5);
-
-    QFont smallerFont;
-    smallerFont.setPointSize(smallerFont.pointSize()*.85);
-    smallerFont.setBold(true);
+    QFont biggerFont = FontUtils::big();
+    QFont smallerFont = FontUtils::smallBold();
 
     QBoxLayout *mainLayout = new QVBoxLayout();
     mainLayout->setMargin(PADDING);
index 9463b669ae77fa2d49dea4777866de9c486177ec..cc25c4dcd898f861daf4d81e65eb3ba65da383d1 100644 (file)
@@ -1,5 +1,6 @@
 #include "PrettyItemDelegate.h"
 #include "../ListModel.h"
+#include "../fontutils.h"
 
 #include <QFontMetricsF>
 #include <QPainter>
@@ -9,16 +10,9 @@ const qreal PrettyItemDelegate::THUMB_WIDTH = 120.0;
 const qreal PrettyItemDelegate::PADDING = 10.0;
 
 PrettyItemDelegate::PrettyItemDelegate( QObject* parent ) : QStyledItemDelegate( parent ) {
-
     boldFont.setBold(true);
-    smallerFont.setPointSize(smallerFont.pointSize()*.85);
-    smallerBoldFont.setBold(true);
-    smallerBoldFont.setPointSize(smallerBoldFont.pointSize()*.85);
-    QFontInfo fontInfo(smallerFont);
-    if (fontInfo.pixelSize() < 10) {
-        smallerFont.setPixelSize(10);
-        smallerBoldFont.setPixelSize(10);
-    }
+    smallerBoldFont = FontUtils::smallBold();
+    smallerFont = FontUtils::small();
     createPlayIcon();
 }
 
index 0043fc57c54db995ab4910d62d21915382feae3d..8ec74383ae2a1fe16968e51469e5d18360fb8f71 100644 (file)
@@ -4,6 +4,7 @@
 #include <QtGui>
 
 #include "thblackbar.h"
+#include "../fontutils.h"
 
 /* ============================================================================
  *  PRIVATE Class
@@ -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) {
@@ -247,9 +246,7 @@ void THBlackBar::drawButton (       QPainter *painter,
     painter->fillRect(0, mh, width, mh, color);
     painter->drawRect(0, 0, width, height);
 
-    QFont smallerBoldFont;
-    smallerBoldFont.setBold(true);
-    smallerBoldFont.setPointSize(smallerBoldFont.pointSize()*.85);
+    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());