File indexing completed on 2024-05-12 04:58:27

0001 /* ============================================================
0002 * Falkon - Qt web browser
0003 * Copyright (C) 2013-2017 David Rosca <nowrep@gmail.com>
0004 * Copyright (C) 2013-2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
0005 *
0006 * This program is free software: you can redistribute it and/or modify
0007 * it under the terms of the GNU General Public License as published by
0008 * the Free Software Foundation, either version 3 of the License, or
0009 * (at your option) any later version.
0010 *
0011 * This program is distributed in the hope that it will be useful,
0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014 * GNU General Public License for more details.
0015 *
0016 * You should have received a copy of the GNU General Public License
0017 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018 * ============================================================ */
0019 #ifndef MACTOOLBUTTON_H
0020 #define MACTOOLBUTTON_H
0021 
0022 #include "qzcommon.h"
0023 
0024 #ifdef Q_OS_MACOS
0025 #include <QPushButton>
0026 
0027 class FALKON_EXPORT MacToolButton : public QPushButton
0028 {
0029     Q_OBJECT
0030     Q_PROPERTY(bool autoRaise READ autoRaise WRITE setAutoRaise)
0031 
0032 public:
0033     explicit MacToolButton(QWidget* parent = nullptr);
0034 
0035     void setIconSize(const QSize &size);
0036 
0037     void setAutoRaise(bool enable);
0038     bool autoRaise() const;
0039 
0040 private:
0041     bool m_autoRise;
0042     QSize m_buttonFixedSize;
0043 };
0044 #else
0045 #include <QToolButton>
0046 
0047 class FALKON_EXPORT MacToolButton : public QToolButton
0048 {
0049     Q_OBJECT
0050 
0051 public:
0052     explicit MacToolButton(QWidget* parent = nullptr);
0053 };
0054 #endif
0055 #endif // MACTOOLBUTTON_H