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
void DolphinSearchBox::slotFacetsButtonToggled()
{
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()
}
void DolphinSearchBox::slotFacetChanged()
{
SearchSettings::setLocation(m_fromHereButton->isChecked() ? "FromHere" : "Everywhere");
SearchSettings::setWhat(m_fileNameButton->isChecked() ? "FileName" : "Content");
{
SearchSettings::setLocation(m_fromHereButton->isChecked() ? "FromHere" : "Everywhere");
SearchSettings::setWhat(m_fileNameButton->isChecked() ? "FileName" : "Content");
+ SearchSettings::setShowFacetsWidget(m_facetsToggleButton->isChecked() ? true : false);
SearchSettings::self()->writeConfig();
}
SearchSettings::self()->writeConfig();
}
// Create "Facets" widgets
m_facetsToggleButton = new QToolButton(this);
// 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);
connect(m_facetsToggleButton, SIGNAL(clicked()), this, SLOT(slotFacetsButtonToggled()));
m_facetsWidget = new DolphinFacetsWidget(this);
m_startSearchTimer->setInterval(1000);
connect(m_startSearchTimer, SIGNAL(timeout()), this, SLOT(emitSearchRequest()));
m_startSearchTimer->setInterval(1000);
connect(m_startSearchTimer, SIGNAL(timeout()), this, SLOT(emitSearchRequest()));
- updateFacetsToggleButtonIcon();
+ updateFacetsToggleButton();
-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"
}
#include "dolphinsearchbox.moc"
void applyReadOnlyState();
void applyReadOnlyState();
- void updateFacetsToggleButtonIcon();
-
+ void updateFacetsToggleButton();
private:
bool m_startedSearching;
bool m_readOnly;
private:
bool m_startedSearching;
bool m_readOnly;