2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2022 Felix Ernst <fe.a.ernst@gmail.com>
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
8 #ifndef SELECTIONMODETOPBAR_H
9 #define SELECTIONMODETOPBAR_H
14 #include <QPropertyAnimation>
27 class SelectionModeTopBar
: public QWidget
32 SelectionModeTopBar(QWidget
*parent
);
35 * Plays a show or hide animation while changing visibility.
36 * Therefore, if this method is used to hide this widget, the actual hiding will be postponed until the animation finished.
37 * @see QWidget::setVisible()
39 void setVisible(bool visible
, Animated animated
);
40 using QWidget::setVisible
; // Makes sure that the setVisible() declaration above doesn't hide the one from QWidget.
43 void leaveSelectionModeRequested();
46 void resizeEvent(QResizeEvent */
* resizeEvent */
) override
;
49 /** Decides whether the m_fullLabelString or m_shortLabelString should be used based on available width. */
50 void updateLabelString();
54 QPushButton
*m_closeButton
;
56 /** @see updateLabelString() */
57 QString m_fullLabelString
;
58 /** @see updateLabelString() */
59 QString m_shortLabelString
;
61 int m_preferredHeight
;
63 QPointer
<QPropertyAnimation
> m_heightAnimation
;
66 #endif // SELECTIONMODETOPBAR_H