File indexing completed on 2024-04-28 04:48:37

0001 /*
0002     SPDX-FileCopyrightText: 2005 Max Howell <max.howell@methylblue.com>
0003     SPDX-FileCopyrightText: 2007 Ian Monroe <ian@monroe.nu>
0004 
0005     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 */
0007 
0008 #ifndef DRAGONPLAYER_ADJUST_SIZE_BUTTON_H
0009 #define DRAGONPLAYER_ADJUST_SIZE_BUTTON_H
0010 
0011 #include <QFrame>
0012 
0013 class QEvent;
0014 class QTimerEvent;
0015 class QPushButton;
0016 
0017 namespace Dragon
0018 {
0019 class AdjustSizeButton : public QFrame
0020 {
0021     Q_OBJECT
0022     int m_counter;
0023     int m_stage;
0024     int m_offset;
0025     int m_timerId;
0026 
0027     QPushButton *m_preferred;
0028     QPushButton *m_oneToOne;
0029 
0030     QFrame *m_thingy;
0031 
0032 public:
0033     explicit AdjustSizeButton(QWidget *parent);
0034 
0035 private:
0036     void timerEvent(QTimerEvent *) override;
0037     bool eventFilter(QObject *, QEvent *) override;
0038 
0039     inline void move()
0040     {
0041         QWidget::move(parentWidget()->width() - width(), parentWidget()->height() - m_offset);
0042     }
0043 };
0044 }
0045 
0046 #endif