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

45 lines
1.2 KiB
C++
Raw Normal View History

2021-04-04 21:04:12 +01:00
#pragma once
#include <QWidget>
2021-11-20 19:08:35 +00:00
#include <QPainter>
2021-04-04 21:04:12 +01:00
namespace Bloom::Widgets::InsightTargetWidgets::Dip
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)
2021-04-04 21:04:12 +01:00
public:
2021-11-20 19:08:35 +00:00
static constexpr int HEIGHT = 130;
explicit BodyWidget(QWidget* parent);
2021-04-04 21:04:12 +01:00
2021-06-21 00:14:31 +01:00
[[nodiscard]] QColor getBodyColor() const {
2021-04-04 21:04:12 +01:00
return this->bodyColor;
}
2021-06-21 00:14:31 +01:00
void setBodyColor(const QColor& color) {
2021-04-04 21:04:12 +01:00
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;
}
protected:
void paintEvent(QPaintEvent* event) override;
void drawWidget(QPainter& painter);
private:
// These properties can be modified via Qt style sheets (see Stylesheets/DualInlinePackage.qss)
QColor bodyColor = QColor("#8E8B83");
int disableAlphaLevel = 100;
2021-04-04 21:04:12 +01:00
};
}