/***************************************************************************
 **
 **  Copyright (C) 2018-2023 wangjianjun <wangjianjun1018@qq.com>
 **  Contact: https://blog.csdn.net/wocanimei007?type=blog
 **
 **
****************************************************************************/
#ifndef FANCYTAB_H
#define FANCYTAB_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include "fancybutton.h"



class FancyTabPrivate;
class FancyTab : public FancyButton
{
    Q_OBJECT
public:
    enum TabType { Mode, Action };

    explicit FancyTab(QWidget *parent = nullptr);
    FancyTab(const QIcon &icon, QWidget *parent = nullptr);
    virtual ~FancyTab();

    virtual void select(bool selected);
    bool isSelected();

    void setType(TabType type);
    TabType type() const;

    void setSelectedTextColor(const QColor &color);

    void setColor(const QColor &color);

protected:
    virtual void enterEvent(QEvent *event);
    virtual void leaveEvent(QEvent *event);
    virtual void mousePressEvent(QMouseEvent *event);
    virtual void mouseReleaseEvent(QMouseEvent *event);

    virtual void paintEvent(QPaintEvent *event);

private:
    void update();

private:
    FancyTabPrivate *d;
};



#endif // FANCYTAB_H
