diff options
| author | Don Nguyen <[email protected]> | 2017-02-18 22:55:38 +0100 |
|---|---|---|
| committer | Emmanuel Pescosta <[email protected]> | 2017-02-18 22:55:38 +0100 |
| commit | edf8e5737316204e4a96e5edf4cba4cdec1c71ef (patch) | |
| tree | 5e2e7e391442f7c54924499029a4aec9009e8b5b /src | |
| parent | db3f3746798a74d25dbfaeeaa1abd1b71c93613b (diff) | |
Make "show filter bar" a toggle action
REVIEW: 129662
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 6 | ||||
| -rw-r--r-- | src/dolphinmainwindow.h | 2 | ||||
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index a2e9c0dd8..185db7193 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -552,9 +552,9 @@ void DolphinMainWindow::disableStopAction() actionCollection()->action(QStringLiteral("stop"))->setEnabled(false); } -void DolphinMainWindow::showFilterBar() +void DolphinMainWindow::showFilterBar(bool show) { - m_activeViewContainer->setFilterBarVisible(true); + m_activeViewContainer->setFilterBarVisible(show); } void DolphinMainWindow::toggleEditLocation() @@ -1110,7 +1110,7 @@ void DolphinMainWindow::setupActions() KStandardAction::home(this, SLOT(goHome()), actionCollection()); // setup 'Tools' menu - QAction* showFilterBar = actionCollection()->addAction(QStringLiteral("show_filter_bar")); + KToggleAction* showFilterBar = actionCollection()->add<KToggleAction>(QStringLiteral("show_filter_bar")); showFilterBar->setText(i18nc("@action:inmenu Tools", "Show Filter Bar")); showFilterBar->setIcon(QIcon::fromTheme(QStringLiteral("view-filter"))); actionCollection()->setDefaultShortcut(showFilterBar, Qt::CTRL | Qt::Key_I); diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index d741eb21e..219bcdcb9 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -236,7 +236,7 @@ private slots: void enableStopAction(); void disableStopAction(); - void showFilterBar(); + void showFilterBar(bool show); /** * Toggles between edit and browse mode of the navigation bar. diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 72ced931b..a9825f47e 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -389,6 +389,7 @@ void DolphinViewContainer::setFilterBarVisible(bool visible) m_filterBar->show(); m_filterBar->setFocus(); m_filterBar->selectAll(); + emit showFilterBarChanged(true); } else { closeFilterBar(); } |
