From 15555b37c2672fb3367876192764c33e4b33bf93 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 30 Oct 2021 21:46:47 +0100 Subject: [PATCH] Fixed DIP pin body alignment issue with variable sized pin names --- .../InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.cpp index 1b21ee94..77171fbe 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.cpp @@ -9,7 +9,8 @@ PinWidget::PinWidget( InsightWorker& insightWorker, QWidget* parent ): TargetPinWidget(pinDescriptor, targetVariant, insightWorker, parent) { - this->setFixedSize(PinWidget::MINIMUM_WIDTH + PinWidget::WIDTH_SPACING, PinWidget::MAXIMUM_HEIGHT); + static constexpr auto width = PinWidget::MINIMUM_WIDTH + PinWidget::WIDTH_SPACING; + this->setFixedSize(width, PinWidget::MAXIMUM_HEIGHT); this->layout = new QVBoxLayout(); this->layout->setContentsMargins(0, 0, 0, 0); @@ -38,6 +39,7 @@ PinWidget::PinWidget( this->pinNameLabel->setText(pinName); this->pinNameLabel->setAlignment(Qt::AlignmentFlag::AlignCenter); this->pinNameLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + this->pinNameLabel->setFixedWidth(width); this->pinNumberLabel = new QLabel(this); this->pinNumberLabel->setObjectName("target-pin-number");