From 267610cdddd7de2e5982848d82a9e7ca51232e9d Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Fri, 4 Sep 2009 11:23:02 +0200 Subject: [PATCH] Layout refinements --- src/MainWindow.cpp | 1 + src/SearchView.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 5225425..41ec0fa 100755 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -27,6 +27,7 @@ MainWindow::MainWindow() { toolbarSearch = new SearchLineEdit(this); toolbarSearch->setFont(qApp->font()); + toolbarSearch->setMinimumWidth(toolbarSearch->fontInfo().pixelSize()*15); connect(toolbarSearch, SIGNAL(search(const QString&)), searchView, SLOT(watch(const QString&))); // build ui diff --git a/src/SearchView.cpp b/src/SearchView.cpp index 762f3e1..6d95d96 100644 --- a/src/SearchView.cpp +++ b/src/SearchView.cpp @@ -58,15 +58,16 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) { tipLabel->setFont(biggerFont); layout->addWidget(tipLabel); + layout->addSpacing(10); + QHBoxLayout *searchLayout = new QHBoxLayout(); searchLayout->setAlignment(Qt::AlignVCenter); queryEdit = new SearchLineEdit(this); queryEdit->setFont(biggerFont); - queryEdit->setMinimumWidth(300); + queryEdit->setMinimumWidth(queryEdit->fontInfo().pixelSize()*15); queryEdit->sizeHint(); queryEdit->setFocus(Qt::OtherFocusReason); - // connect(queryEdit, SIGNAL(returnPressed()), this, SLOT(watch())); connect(queryEdit, SIGNAL(search(const QString&)), this, SLOT(watch(const QString&))); connect(queryEdit, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &))); searchLayout->addWidget(queryEdit); -- 2.39.5