]>
cloud.milkyroute.net Git - dolphin.git/blob - src/filterbar/filterbar.h
2 * SPDX-FileCopyrightText: 2006-2010 Peter Penz <peter.penz19@gmail.com>
3 * SPDX-FileCopyrightText: 2006 Gregor Kališnik <gregor@podnapisi.net>
4 * SPDX-FileCopyrightText: 2012 Stuart Citrin <ctrn3e8@gmail.com>
6 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "animatedheightwidget.h"
18 * @brief Provides an input field for filtering the currently shown items.
20 * @author Gregor Kališnik <gregor@podnapisi.net>
22 class FilterBar
: public AnimatedHeightWidget
27 explicit FilterBar(QWidget
*parent
= nullptr);
28 ~FilterBar() override
;
30 /** Called by view container to hide this **/
31 void closeFilterBar();
34 * Selects the whole text of the filter bar.
39 /** Clears the input field. */
41 /** Clears the input field if the "lock button" is disabled. */
42 void clearIfUnlocked();
43 /** The input field is cleared also if the "lock button" is released. */
44 void slotToggleLockButton(bool checked
);
48 * Signal that reports the name filter has been
49 * changed to \a nameFilter.
51 void filterChanged(const QString
&nameFilter
);
54 * Emitted as soon as the filterbar should get closed.
59 * Emitted as soon as the focus should be returned back to the view.
61 void focusViewRequest();
64 void showEvent(QShowEvent
*event
) override
;
65 void keyPressEvent(QKeyEvent
*event
) override
;
67 /** @see AnimatedHeightWidget::preferredHeight() */
68 int preferredHeight() const override
;
71 QLineEdit
*m_filterInput
;
72 QToolButton
*m_lockButton
;