2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2022 Felix Ernst <felixernst@kde.org>
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
11 #include "animatedheightwidget.h"
17 namespace SelectionMode
21 * @brief A bar appearing at the top of the view when in selection mode to make users aware of the selection mode state of the application.
23 class TopBar
: public AnimatedHeightWidget
28 TopBar(QWidget
*parent
);
31 void selectionModeLeavingRequested();
34 /** Calls updateLabelString() */
35 void resizeEvent(QResizeEvent
*resizeEvent
) override
;
38 /** Decides whether the m_fullLabelString or m_shortLabelString should be used based on available width. */
39 void updateLabelString();
41 /** @see AnimatedHeightWidget::preferredHeight() */
42 inline int preferredHeight() const override
44 return m_preferredHeight
;
49 QPushButton
*m_closeButton
;
51 /** @see updateLabelString() */
52 QString m_fullLabelString
;
53 /** @see updateLabelString() */
54 QString m_shortLabelString
;
56 int m_preferredHeight
;
61 #endif // SELECTIONMODETOPBAR_H