diff options
| author | Frank Reininghaus <[email protected]> | 2012-09-06 08:03:56 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2012-09-06 08:03:56 +0200 |
| commit | 7b64f58a6ccd20c743452bbc706fab15462bd43b (patch) | |
| tree | 69f8334403e9f511f2f549fc6282d23bf475643d /src/search | |
| parent | cad870df3bf22592d4c3feeaef22923d1300e482 (diff) | |
Make the button that enables additional search options more obvious
This is achieved by adding some descriptive text and by using a more
appropriate icon.
Thanks to Panos Kanavos for the patch!
BUG: 300248
FIXED-IN: 4.10.0
REVIEW: 106325
Diffstat (limited to 'src/search')
| -rw-r--r-- | src/search/dolphinsearchbox.cpp | 21 | ||||
| -rw-r--r-- | src/search/dolphinsearchbox.h | 3 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 28f1f1af5..a9a4b667a 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -239,10 +239,9 @@ void DolphinSearchBox::slotReturnPressed(const QString& text) void DolphinSearchBox::slotFacetsButtonToggled() { - const bool visible = !m_facetsWidget->isVisible(); - m_facetsWidget->setVisible(visible); - SearchSettings::setShowFacetsWidget(visible); - updateFacetsToggleButtonIcon(); + const bool facetsIsVisible = !m_facetsWidget->isVisible(); + m_facetsWidget->setVisible(facetsIsVisible); + updateFacetsToggleButton(); } void DolphinSearchBox::slotFacetChanged() @@ -281,6 +280,7 @@ void DolphinSearchBox::saveSettings() { SearchSettings::setLocation(m_fromHereButton->isChecked() ? "FromHere" : "Everywhere"); SearchSettings::setWhat(m_fileNameButton->isChecked() ? "FileName" : "Content"); + SearchSettings::setShowFacetsWidget(m_facetsToggleButton->isChecked() ? true : false); SearchSettings::self()->writeConfig(); } @@ -343,7 +343,8 @@ void DolphinSearchBox::init() // Create "Facets" widgets m_facetsToggleButton = new QToolButton(this); - m_facetsToggleButton->setAutoRaise(true); + m_facetsToggleButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + initButton(m_facetsToggleButton); connect(m_facetsToggleButton, SIGNAL(clicked()), this, SLOT(slotFacetsButtonToggled())); m_facetsWidget = new DolphinFacetsWidget(this); @@ -390,7 +391,7 @@ void DolphinSearchBox::init() m_startSearchTimer->setInterval(1000); connect(m_startSearchTimer, SIGNAL(timeout()), this, SLOT(emitSearchRequest())); - updateFacetsToggleButtonIcon(); + updateFacetsToggleButton(); applyReadOnlyState(); } @@ -467,10 +468,12 @@ void DolphinSearchBox::applyReadOnlyState() } } -void DolphinSearchBox::updateFacetsToggleButtonIcon() +void DolphinSearchBox::updateFacetsToggleButton() { - const bool visible = SearchSettings::showFacetsWidget(); - m_facetsToggleButton->setIcon(KIcon(visible ? "list-remove" : "list-add")); + const bool facetsIsVisible = SearchSettings::showFacetsWidget(); + m_facetsToggleButton->setChecked(facetsIsVisible ? true : false); + m_facetsToggleButton->setIcon(KIcon(facetsIsVisible ? "arrow-up-double" : "arrow-down-double")); + m_facetsToggleButton->setText(facetsIsVisible ? i18nc("action:button", "Less Options") : i18nc("action:button", "More Options")); } #include "dolphinsearchbox.moc" diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index ee9987a38..f3cc535d6 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -133,8 +133,7 @@ private: void applyReadOnlyState(); - void updateFacetsToggleButtonIcon(); - + void updateFacetsToggleButton(); private: bool m_startedSearching; bool m_readOnly; |
