From: Flavio Tordini Date: Mon, 22 Jun 2009 13:27:10 +0000 (+0200) Subject: Fix alignment and color on OSX X-Git-Tag: 0.4~41 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=660b600214409355eecf08554a3c43a9db19ac59;p=minitube Fix alignment and color on OSX --- diff --git a/src/loadingwidget.cpp b/src/loadingwidget.cpp index 59fc58b..bc62500 100644 --- a/src/loadingwidget.cpp +++ b/src/loadingwidget.cpp @@ -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);