From 660b600214409355eecf08554a3c43a9db19ac59 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Mon, 22 Jun 2009 15:27:10 +0200 Subject: [PATCH] Fix alignment and color on OSX --- src/loadingwidget.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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); -- 2.39.5