]> git.sur5r.net Git - minitube/commitdiff
Fix alignment and color on OSX
authorFlavio Tordini <flavio.tordini@gmail.com>
Mon, 22 Jun 2009 13:27:10 +0000 (15:27 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Mon, 22 Jun 2009 13:27:10 +0000 (15:27 +0200)
src/loadingwidget.cpp

index 59fc58bc6c44be64d83fd392d4d4e9b61c06c4c1..bc625008e820bd1b2d1ba63363cda64c6dcc35f8 100644 (file)
@@ -9,14 +9,19 @@ LoadingWidget::LoadingWidget(QWidget *parent) : QWidget(parent) {
 
     setAutoFillBackground(true);
 
-    QBoxLayout *layout = new QVBoxLayout();
-    layout->setAlignment(Qt::AlignCenter);
-
     QFont bigFont;
     bigFont.setPointSize(bigFont.pointSize()*4);
+    QFontMetrics fm(bigFont);
+    int textHeightInPixels = fm.height();
+    int spacing = textHeightInPixels / 2;
+
+    QBoxLayout *layout = new QVBoxLayout();
+    layout->setSpacing(spacing);
+    layout->setMargin(spacing);
 
     titleLabel = new QLabel(this);
-    titleLabel->setAlignment(Qt::AlignCenter);
+    titleLabel->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
+    titleLabel->setPalette(p);
     titleLabel->setForegroundRole(QPalette::Text);
     titleLabel->setWordWrap(true);
     titleLabel->setFont(bigFont);
@@ -27,7 +32,8 @@ LoadingWidget::LoadingWidget(QWidget *parent) : QWidget(parent) {
     biggerFont.setPointSize(biggerFont.pointSize()*2);
 
     descriptionLabel = new QLabel(this);
-    descriptionLabel->setAlignment(Qt::AlignCenter);
+    descriptionLabel->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
+    descriptionLabel->setPalette(p);
     descriptionLabel->setForegroundRole(QPalette::Text);
     descriptionLabel->setWordWrap(true);
     descriptionLabel->setFont(biggerFont);