chore: adjusted the project directory structure

This commit is contained in:
Gary Wang
2020-11-05 14:12:58 +08:00
parent 1066fa45ea
commit 8c152dc862
29 changed files with 213 additions and 213 deletions

28
app/toolbutton.cpp Normal file
View File

@ -0,0 +1,28 @@
#include "toolbutton.h"
#include "opacityhelper.h"
#include <QPainter>
#include <QGraphicsOpacityEffect>
#include <QPropertyAnimation>
ToolButton::ToolButton(bool hoverColor, QWidget *parent)
: QPushButton(parent)
, m_opacityHelper(new OpacityHelper(this))
{
setFlat(true);
QString qss = "QPushButton {"
"background: transparent;"
"}";
if (hoverColor) {
qss += "QPushButton:hover {"
"background: red;"
"}";
}
setStyleSheet(qss);
}
void ToolButton::setOpacity(qreal opacity, bool animated)
{
m_opacityHelper->setOpacity(opacity, animated);
}