Made DIP body widget height dynamic, along with indicator sizes.

This commit is contained in:
Nav
2021-12-01 02:33:41 +00:00
parent 5716e6f306
commit 9b1fbb1481
3 changed files with 68 additions and 43 deletions

View File

@@ -12,9 +12,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip
Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true)
public:
static constexpr int HEIGHT = 130;
explicit BodyWidget(QWidget* parent);
explicit BodyWidget(QWidget* parent, std::size_t pinCount);
[[nodiscard]] QColor getBodyColor() const {
return this->bodyColor;
@@ -37,8 +35,15 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip
void drawWidget(QPainter& painter);
private:
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;
// These properties can be modified via Qt style sheets (see Stylesheets/DualInlinePackage.qss)
QColor bodyColor = QColor("#8E8B83");
int disableAlphaLevel = 100;
int firstPinIndicatorDiameter = 14;
int orientationIndicatorDiameter = 16;
};
}