4c75f9e
/*
4c75f9e
    Copyright (c) 2017, Lukas Holecek <hluk@email.cz>
4c75f9e
4c75f9e
    This file is part of CopyQ.
4c75f9e
4c75f9e
    CopyQ is free software: you can redistribute it and/or modify
4c75f9e
    it under the terms of the GNU General Public License as published by
4c75f9e
    the Free Software Foundation, either version 3 of the License, or
4c75f9e
    (at your option) any later version.
4c75f9e
4c75f9e
    CopyQ is distributed in the hope that it will be useful,
4c75f9e
    but WITHOUT ANY WARRANTY; without even the implied warranty of
4c75f9e
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4c75f9e
    GNU General Public License for more details.
4c75f9e
4c75f9e
    You should have received a copy of the GNU General Public License
4c75f9e
    along with CopyQ.  If not, see <http://www.gnu.org/licenses/>.
4c75f9e
*/
4c75f9e
4c75f9e
#ifndef ICONSELECTBUTTON_H
4c75f9e
#define ICONSELECTBUTTON_H
4c75f9e
4c75f9e
#include <QPushButton>
4c75f9e
4c75f9e
class IconSelectButton : public QPushButton
4c75f9e
{
4c75f9e
    Q_OBJECT
4c75f9e
    Q_PROPERTY(QString currentIcon READ currentIcon WRITE setCurrentIcon NOTIFY currentIconChanged)
4c75f9e
public:
4c75f9e
    explicit IconSelectButton(QWidget *parent = nullptr);
4c75f9e
4c75f9e
    const QString &currentIcon() const { return m_currentIcon; }
4c75f9e
4c75f9e
    QSize sizeHint() const override;
4c75f9e
4c75f9e
public slots:
4c75f9e
    void setCurrentIcon(const QString &iconString);
4c75f9e
4c75f9e
signals:
4c75f9e
    void currentIconChanged(const QString &icon);
4c75f9e
4c75f9e
private slots:
4c75f9e
    void onClicked();
4c75f9e
4c75f9e
private:
4c75f9e
    QString m_currentIcon;
4c75f9e
};
4c75f9e
4c75f9e
#endif // ICONSELECTBUTTON_H