mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00

Modify project to pass the REUSE check Log: Modify project to pass the REUSE check Task: https://pms.uniontech.com/task-view-185215.html Change-Id: Ie954cf985f16c1a243bfc912aa7458c6e85ce9de
44 lines
882 B
C++
44 lines
882 B
C++
// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd.
|
|
//
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
#ifndef STATEBUTTON_H
|
|
#define STATEBUTTON_H
|
|
|
|
#include <QWidget>
|
|
|
|
class StateButton : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum Type {
|
|
Check,
|
|
Fork
|
|
};
|
|
|
|
public:
|
|
explicit StateButton(QWidget *parent = nullptr);
|
|
void setType(Type type);
|
|
void setSwitchFork(bool switchFork);
|
|
|
|
signals:
|
|
void click();
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event) override;
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
void enterEvent(QEvent *event) override;
|
|
void leaveEvent(QEvent *event) override;
|
|
|
|
private:
|
|
void drawCheck(QPainter &painter, QPen &pen, int radius);
|
|
void drawFork(QPainter &painter, QPen &pen, int radius);
|
|
|
|
private:
|
|
Type m_type;
|
|
bool m_switchFork;
|
|
};
|
|
|
|
#endif // STATEBUTTON_H
|