Files
BloomPatched/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/BodyWidget.hpp

44 lines
1.2 KiB
C++
Raw Normal View History

2021-04-04 21:04:12 +01:00
#pragma once
#include <QWidget>
namespace Bloom::Widgets::InsightTargetWidgets::Qfp
2021-04-04 21:04:12 +01:00
{
class BodyWidget: public QWidget
{
Q_OBJECT
Q_PROPERTY(QColor bodyColor READ getBodyColor WRITE setBodyColor DESIGNABLE true)
Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true)
private:
// These properties can be modified via Qt style sheets (see Stylesheets/QuadFlatPackage.qss)
2021-04-04 21:04:12 +01:00
QColor bodyColor = QColor("#AFB1B3");
int disableAlphaLevel = 100;
protected:
2021-06-21 00:14:31 +01:00
void paintEvent(QPaintEvent* event) override;
2021-04-04 21:04:12 +01:00
void drawWidget(QPainter& painter);
public:
2021-06-21 00:14:31 +01:00
explicit BodyWidget(QWidget* parent): QWidget(parent) {
2021-04-04 21:04:12 +01:00
this->setObjectName("target-body");
}
2021-06-21 00:14:31 +01:00
[[nodiscard]] QColor getBodyColor() const {
2021-04-04 21:04:12 +01:00
return this->bodyColor;
}
void setBodyColor(QColor color) {
this->bodyColor = color;
}
2021-06-21 00:14:31 +01:00
[[nodiscard]] int getDisableAlphaLevel() const {
2021-04-04 21:04:12 +01:00
return this->disableAlphaLevel;
}
void setDisableAlphaLevel(int level) {
this->disableAlphaLevel = level;
}
};
}