From: Flavio Tordini Date: Thu, 3 Sep 2009 14:09:43 +0000 (+0200) Subject: Really fixed search view X-Git-Tag: 0.6~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e9578cf6a2dddc1200f8783f85ef0836bc05e4fb;p=minitube Really fixed search view --- diff --git a/src/SearchView.cpp b/src/SearchView.cpp index 4837f5f..762f3e1 100644 --- a/src/SearchView.cpp +++ b/src/SearchView.cpp @@ -19,23 +19,29 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) { smallerFont.setPointSize(smallerFont.pointSize()*.85); smallerFont.setBold(true); - QBoxLayout *mainLayout = new QHBoxLayout(); - mainLayout->setAlignment(Qt::AlignCenter); - mainLayout->setMargin(PADDING); - - QLabel *logo = new QLabel(this); - logo->setPixmap(QPixmap(":/images/app.png")); - mainLayout->addWidget(logo, 0, Qt::AlignTop); - mainLayout->addSpacing(PADDING); + QBoxLayout *mainLayout = new QVBoxLayout(); + mainLayout->setMargin(0); + mainLayout->setSpacing(0); // hidden message widget message = new QLabel(this); message->hide(); mainLayout->addWidget(message); + mainLayout->addStretch(); + + QBoxLayout *hLayout = new QHBoxLayout(); + hLayout->setAlignment(Qt::AlignCenter); + mainLayout->addLayout(hLayout); + + QLabel *logo = new QLabel(this); + logo->setPixmap(QPixmap(":/images/app.png")); + hLayout->addWidget(logo, 0, Qt::AlignTop); + hLayout->addSpacing(PADDING); + QVBoxLayout *layout = new QVBoxLayout(); layout->setAlignment(Qt::AlignCenter); - mainLayout->addLayout(layout); + hLayout->addLayout(layout); QLabel *welcomeLabel = new QLabel("

" + @@ -74,7 +80,6 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) { connect(watchButton, SIGNAL(clicked()), this, SLOT(watch())); searchLayout->addWidget(watchButton); - layout->addItem(searchLayout); layout->addSpacing(PADDING); @@ -82,7 +87,8 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) { QHBoxLayout *otherLayout = new QHBoxLayout(); recentKeywordsLayout = new QVBoxLayout(); - recentKeywordsLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); + recentKeywordsLayout->setSpacing(5); + recentKeywordsLayout->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); recentKeywordsLabel = new QLabel(tr("Recent keywords").toUpper(), this); recentKeywordsLabel->hide(); recentKeywordsLabel->setForegroundRole(QPalette::Dark); @@ -93,6 +99,8 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) { layout->addLayout(otherLayout); + mainLayout->addStretch(); + setLayout(mainLayout); updateChecker = 0;