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"
13 class KContextualHelpButton
;
18 namespace SelectionMode
22 * @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.
24 class TopBar
: public AnimatedHeightWidget
29 TopBar(QWidget
*parent
);
32 void selectionModeLeavingRequested();
35 /** Calls updateLabelString() */
36 void resizeEvent(QResizeEvent
*resizeEvent
) override
;
39 /** Decides whether the m_fullLabelString or m_shortLabelString should be used based on available width. */
40 void updateLabelString();
42 /** @see AnimatedHeightWidget::preferredHeight() */
43 inline int preferredHeight() const override
45 return m_preferredHeight
;
50 KContextualHelpButton
*m_contextualHelpButton
;
51 QPushButton
*m_closeButton
;
53 /** @see updateLabelString() */
54 QString m_fullLabelString
;
55 /** @see updateLabelString() */
56 QString m_shortLabelString
;
58 int m_preferredHeight
;
63 #endif // SELECTIONMODETOPBAR_H