Sandboxie/SandboxiePlus/MiscHelpers/Common/CollapsibleGroupBox.h

42 lines
902 B
C
Raw Normal View History

2021-10-16 16:19:51 +01:00
#ifndef COLLAPSIBLEGROUPBOX_H
#define COLLAPSIBLEGROUPBOX_H
#include <QGroupBox>
#include <QMap>
#include <QMargins>
#include <QPair>
#include <QToolButton>
class QResizeEvent;
class CollapseExpandButton;
class QSpacerItem;
2021-06-05 09:53:58 +01:00
#include "../mischelpers_global.h"
2021-10-16 16:19:51 +01:00
class MISCHELPERS_EXPORT CCollapsibleGroupBox : public QGroupBox
{
public:
explicit CCollapsibleGroupBox(QWidget *parent = nullptr);
protected:
void resizeEvent(QResizeEvent *);
private:
void resizeCollapseButton();
void collapseLayout(QLayout *layout);
void collapseSpacer(QSpacerItem *spacer);
void expandLayout(QLayout *layout);
void expandSpacer(QSpacerItem *spacer);
QToolButton *m_clExpButton;
QMap<const void *, QMargins> m_layoutMargins;
QMap<const void *, QPair<QSize, QSizePolicy>> m_spacerSizes;
private slots:
void onScreenChanged();
void onVisibilityChanged();
};
#endif // COLLAPSIBLEGROUPBOX_H