From 8e55f2c2409fd6ca9ebc66a6568f4d3bcbef7576 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Sun, 24 Apr 2022 13:18:30 +0200 Subject: Better separation of classes Make obvious when actions trigger selection mode. --- src/selectionmode/selectionmodetopbar.h | 66 --------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 src/selectionmode/selectionmodetopbar.h (limited to 'src/selectionmode/selectionmodetopbar.h') diff --git a/src/selectionmode/selectionmodetopbar.h b/src/selectionmode/selectionmodetopbar.h deleted file mode 100644 index eb26a5c26..000000000 --- a/src/selectionmode/selectionmodetopbar.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - This file is part of the KDE project - SPDX-FileCopyrightText: 2022 Felix Ernst - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -#ifndef SELECTIONMODETOPBAR_H -#define SELECTIONMODETOPBAR_H - -#include "global.h" - -#include -#include -#include -#include - -class QHideEvent; -class QLabel; -class QPushButton; -class QResizeEvent; -class QShowEvent; - -/** - * @todo write docs - */ -class SelectionModeTopBar : public QWidget -{ - Q_OBJECT - -public: - SelectionModeTopBar(QWidget *parent); - - /** - * Plays a show or hide animation while changing visibility. - * Therefore, if this method is used to hide this widget, the actual hiding will be postponed until the animation finished. - * @see QWidget::setVisible() - */ - void setVisible(bool visible, Animated animated); - using QWidget::setVisible; // Makes sure that the setVisible() declaration above doesn't hide the one from QWidget. - -Q_SIGNALS: - void leaveSelectionModeRequested(); - -protected: - void resizeEvent(QResizeEvent */* resizeEvent */) override; - -private: - /** Decides whether the m_fullLabelString or m_shortLabelString should be used based on available width. */ - void updateLabelString(); - -private: - QLabel *m_label; - QPushButton *m_closeButton; - - /** @see updateLabelString() */ - QString m_fullLabelString; - /** @see updateLabelString() */ - QString m_shortLabelString; - - int m_preferredHeight; - - QPointer m_heightAnimation; -}; - -#endif // SELECTIONMODETOPBAR_H -- cgit v1.3