From 61da3d924cecdbea4efa4fc70e461e5273fd5b08 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 7 Jul 2011 11:49:51 +0200 Subject: [PATCH] Use QToolButtons instead of QPushButtons for the searchbar Thanks to Hugo Pereira Da Costa for the patch. BUG: 277227 FIXED-IN: 4.7.0 --- src/search/dolphinsearchbox.cpp | 14 +++++++------- src/search/dolphinsearchbox.h | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 803f0056e..0bad32fe8 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -229,10 +229,10 @@ void DolphinSearchBox::slotReturnPressed(const QString& text) emit returnPressed(text); } -void DolphinSearchBox::initButton(QPushButton* button) +void DolphinSearchBox::initButton(QToolButton* button) { button->setAutoExclusive(true); - button->setFlat(true); + button->setAutoRaise(true); button->setCheckable(true); connect(button, SIGNAL(clicked(bool)), this, SLOT(slotConfigurationChanged())); } @@ -289,11 +289,11 @@ void DolphinSearchBox::init() searchInputLayout->addWidget(m_searchInput); // Create "Filename" and "Content" button - m_fileNameButton = new QPushButton(this); + m_fileNameButton = new QToolButton(this); m_fileNameButton->setText(i18nc("action:button", "Filename")); initButton(m_fileNameButton); - m_contentButton = new QPushButton(); + m_contentButton = new QToolButton(); m_contentButton->setText(i18nc("action:button", "Content")); initButton(m_contentButton);; @@ -306,11 +306,11 @@ void DolphinSearchBox::init() m_separator = new KSeparator(Qt::Vertical, this); // Create "From Here" and "Everywhere"button - m_fromHereButton = new QPushButton(this); + m_fromHereButton = new QToolButton(this); m_fromHereButton->setText(i18nc("action:button", "From Here")); initButton(m_fromHereButton); - m_everywhereButton = new QPushButton(this); + m_everywhereButton = new QToolButton(this); m_everywhereButton->setText(i18nc("action:button", "Everywhere")); initButton(m_everywhereButton); diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index 2d4f31b3b..8af32b377 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -28,7 +28,7 @@ class AbstractSearchFilterWidget; class KLineEdit; class KSeparator; class QFormLayout; -class QPushButton; +class QToolButton; class QScrollArea; class QLabel; class QVBoxLayout; @@ -143,7 +143,7 @@ private slots: void slotReturnPressed(const QString& text); private: - void initButton(QPushButton* button); + void initButton(QToolButton* button); void loadSettings(); void saveSettings(); void init(); @@ -164,11 +164,11 @@ private: QLabel* m_searchLabel; KLineEdit* m_searchInput; QScrollArea* m_optionsScrollArea; - QPushButton* m_fileNameButton; - QPushButton* m_contentButton; + QToolButton* m_fileNameButton; + QToolButton* m_contentButton; KSeparator* m_separator; - QPushButton* m_fromHereButton; - QPushButton* m_everywhereButton; + QToolButton* m_fromHereButton; + QToolButton* m_everywhereButton; KUrl m_searchPath; KUrl m_readOnlyQuery; -- 2.47.3