Batch of performance and animation work: shared FadeHelper/MotionPrefs primitives, hover animators, shadow pixmap caching, smooth scrolling, seek time bubble, and widespread component repaint reductions.
32 lines
701 B
C++
32 lines
701 B
C++
#ifndef COLLAPSIBLESECTION_H
|
|
#define COLLAPSIBLESECTION_H
|
|
|
|
#include <QString>
|
|
#include <QWidget>
|
|
|
|
class QPropertyAnimation;
|
|
class QPushButton;
|
|
class QVBoxLayout;
|
|
|
|
class CollapsibleSection : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit CollapsibleSection(const QString& title, QWidget* parent = nullptr);
|
|
|
|
QVBoxLayout* contentLayout() const { return m_contentLayout; }
|
|
void setExpanded(bool expanded);
|
|
bool isExpanded() const { return m_expanded; }
|
|
|
|
private:
|
|
void updateToggleText();
|
|
|
|
QPushButton* m_toggle;
|
|
QWidget* m_content;
|
|
QVBoxLayout* m_contentLayout;
|
|
QPropertyAnimation* m_heightAnim = nullptr;
|
|
bool m_expanded = false;
|
|
QString m_title;
|
|
};
|
|
|
|
#endif
|