2022-06-19 16:17:38 +08:00
|
|
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
2019-10-06 14:12:52 +08:00
|
|
|
#ifndef TOOLBUTTON_H
|
|
|
|
#define TOOLBUTTON_H
|
|
|
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
2019-10-06 14:58:01 +08:00
|
|
|
class OpacityHelper;
|
2019-10-06 14:12:52 +08:00
|
|
|
class ToolButton : public QPushButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-07-04 13:49:12 +08:00
|
|
|
ToolButton(bool hoverColor = false, QWidget * parent = nullptr);
|
2022-09-29 13:11:21 +08:00
|
|
|
void setIconResourcePath(const QString &iconp);
|
2019-10-06 14:12:52 +08:00
|
|
|
|
|
|
|
public slots:
|
2019-10-06 14:58:01 +08:00
|
|
|
void setOpacity(qreal opacity, bool animated = true);
|
2019-10-06 14:12:52 +08:00
|
|
|
|
|
|
|
private:
|
2019-10-06 14:58:01 +08:00
|
|
|
OpacityHelper * m_opacityHelper;
|
2019-10-06 14:12:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TOOLBUTTON_H
|