/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * Copyright (c) KylinSoft Co., Ltd. 2019.All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

#ifndef PICTUREICONLABEL_H
#define PICTUREICONLABEL_H

#include <QLabel>

#include "drawiconlabel.h"

class PictureIconLabel : public QLabel
{
    Q_OBJECT
public:
    explicit PictureIconLabel(QWidget *parent = nullptr);
    explicit PictureIconLabel(const QPixmap &pixmap, QWidget *parent = nullptr);
    explicit PictureIconLabel(QStringList iStringList, QWidget *parent = nullptr);
    explicit PictureIconLabel(QList<QPixmap> iconList, QWidget *parent = nullptr);

    QPixmap pixmapToRound(const QString &filePath, const QSize &scaledSize) const;
    QPixmap pixmapToRound(const QPixmap &pixmap, const QSize &scaledSize) const;
    void setRadius(int radius);
    void setIcon(const QPixmap &pixmap);

protected:
    void leaveEvent(QEvent * event);
    void enterEvent(QEvent * event);

private:
    DrawIconLabel* m_pictrueLabel = nullptr;
    QStringList m_iconList;
    int m_radius;

Q_SIGNALS:
    void enterWidget();
    void leaveWidget();
};

#endif // PICTUREICONLABEL_H
