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
|
|
|
|
2021-07-07 20:54:45 +01:00
|
|
|
namespace Bloom::Widgets::InsightTargetWidgets::Dip
|
2021-04-04 21:04:12 +01:00
|
|
|
{
|
|
|
|
|
class BodyWidget: public QWidget
|
|
|
|
|
{
|
2021-10-06 21:12:31 +01:00
|
|
|
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-12-01 02:33:41 +00:00
|
|
|
explicit BodyWidget(QWidget* parent, std::size_t pinCount);
|
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;
|
|
|
|
|
}
|
2021-10-06 21:12:31 +01:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void paintEvent(QPaintEvent* event) override;
|
|
|
|
|
void drawWidget(QPainter& painter);
|
|
|
|
|
|
|
|
|
|
private:
|
2021-12-01 02:33:41 +00:00
|
|
|
static constexpr int MAXIMUM_BODY_HEIGHT = 156;
|
|
|
|
|
static constexpr int MINIMUM_BODY_HEIGHT = 80;
|
|
|
|
|
static constexpr int MAXIMUM_FIRST_PIN_INDICATOR_HEIGHT = 16;
|
|
|
|
|
static constexpr int MINIMUM_FIRST_PIN_INDICATOR_HEIGHT = 12;
|
|
|
|
|
|
2021-10-06 21:12:31 +01:00
|
|
|
// These properties can be modified via Qt style sheets (see Stylesheets/DualInlinePackage.qss)
|
|
|
|
|
QColor bodyColor = QColor("#8E8B83");
|
|
|
|
|
int disableAlphaLevel = 100;
|
2021-12-01 02:33:41 +00:00
|
|
|
int firstPinIndicatorDiameter = 14;
|
|
|
|
|
int orientationIndicatorDiameter = 16;
|
2021-04-04 21:04:12 +01:00
|
|
|
};
|
|
|
|
|
}
|