]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use QToolButtons instead of QPushButtons for the searchbar
authorPeter Penz <peter.penz19@gmail.com>
Thu, 7 Jul 2011 09:49:51 +0000 (11:49 +0200)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 7 Jul 2011 09:49:51 +0000 (11:49 +0200)
Thanks to Hugo Pereira Da Costa for the patch.

BUG: 277227
FIXED-IN: 4.7.0

src/search/dolphinsearchbox.cpp
src/search/dolphinsearchbox.h

index 803f0056ecfb98daeb03632b2e8cf514cd5ea253..0bad32fe887361538a3807a30d3227cce1465f20 100644 (file)
@@ -34,7 +34,7 @@
 #include <QHBoxLayout>
 #include <QKeyEvent>
 #include <QLabel>
-#include <QPushButton>
+#include <QToolButton>
 #include <QScrollArea>
 #include <QTimer>
 #include <QToolButton>
@@ -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);
 
index 2d4f31b3b823a0b34e2e42cc94201c3333acbe87..8af32b377f17f4f75cb0e954f21a4cfc58e7cd0b 100644 (file)
@@ -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;