From e9578cf6a2dddc1200f8783f85ef0836bc05e4fb Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Thu, 3 Sep 2009 16:09:43 +0200 Subject: [PATCH] Really fixed search view --- src/SearchView.cpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) 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; -- 2.39.5