File indexing completed on 2024-12-22 04:13:09

0001 #ifndef KISCOLLAPSIBLEBUTTONGROUP_H
0002 #define KISCOLLAPSIBLEBUTTONGROUP_H
0003 
0004 #include <QObject>
0005 #include <QWidget>
0006 #include <QScopedPointer>
0007 
0008 #include "kritaui_export.h"
0009 
0010 class QToolButton;
0011 
0012 class KRITAUI_EXPORT KisCollapsibleButtonGroup : public QWidget
0013 {
0014     Q_OBJECT
0015 public:
0016     KisCollapsibleButtonGroup(QWidget *parent = nullptr);
0017     ~KisCollapsibleButtonGroup() override;
0018 
0019     void setAutoRaise(bool autoRaise);
0020     bool autoRaise() const;
0021     void setIconSize(const QSize& size);
0022     QSize iconSize() const;
0023 
0024     /* setAutoCollapse:
0025      * Set whether we want to try to automatically collapse based on the size
0026      * of the current widget. This can be disabled for manual collapsing.
0027      */
0028     void setAutoCollapse(bool autoCollapse);
0029     void setCollapsed(bool collapse);
0030     bool collapsed() const;
0031 
0032     virtual QSize sizeHint() const override;
0033     virtual QSize minimumSizeHint() const override;
0034 
0035     QToolButton* addAction(QAction* action);
0036 
0037 protected:
0038     virtual void resizeEvent(class QResizeEvent *event) override;
0039 
0040 private:
0041     struct Private;
0042     QScopedPointer<Private> m_d;
0043 };
0044 
0045 #endif // KISCOLLAPSIBLEBUTTONGROUP_H