File indexing completed on 2024-05-19 05:35:23

0001 #ifndef oxygenbuttondemowidget_h
0002 #define oxygenbuttondemowidget_h
0003 
0004 //////////////////////////////////////////////////////////////////////////////
0005 // oxygenbuttondemowidget.h
0006 // oxygen buttons demo widget
0007 // -------------------
0008 //
0009 // SPDX-FileCopyrightText: 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0010 //
0011 // SPDX-License-Identifier: MIT
0012 //////////////////////////////////////////////////////////////////////////////
0013 
0014 #include "oxygendemowidget.h"
0015 #include "ui_oxygenbuttondemowidget.h"
0016 
0017 #include <QList>
0018 #include <QToolBar>
0019 #include <QToolButton>
0020 #include <QWidget>
0021 
0022 namespace Oxygen
0023 {
0024 class ButtonDemoWidget : public DemoWidget
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     //* constructor
0030     explicit ButtonDemoWidget(QWidget * = nullptr);
0031 
0032 public Q_SLOTS:
0033 
0034     void benchmark(void);
0035 
0036 private Q_SLOTS:
0037 
0038     //* change text position in tool buttons
0039     void textPosition(int);
0040 
0041     //* change tool button icon size
0042     void iconSize(int);
0043 
0044     //* set buttons as flat
0045     void toggleFlat(bool);
0046 
0047 private:
0048     void installMenu(QPushButton *);
0049     void installMenu(QToolButton *);
0050 
0051     Ui_ButtonDemoWidget ui;
0052     QToolBar *_toolBar = nullptr;
0053     QList<QPushButton *> _pushButtons;
0054     QList<QToolButton *> _toolButtons;
0055 };
0056 }
0057 
0058 #endif