diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.cpp index 1db36979..42d8f475 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.cpp @@ -7,6 +7,11 @@ using namespace Bloom::Widgets::InsightTargetWidgets::Dip; using namespace Bloom::Targets; +PinBodyWidget::PinBodyWidget(QWidget* parent, Targets::TargetPinDescriptor pinDescriptor) +: TargetPinBodyWidget(parent, std::move(pinDescriptor)) { + this->setFixedSize(PinBodyWidget::WIDTH, PinBodyWidget::HEIGHT); +} + void PinBodyWidget::paintEvent(QPaintEvent* event) { auto painter = QPainter(this); this->drawWidget(painter); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.hpp index a5943a5a..55015496 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.hpp @@ -17,13 +17,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip static const int WIDTH = 19; static const int HEIGHT = 28; - PinBodyWidget( - QWidget* parent, - Targets::TargetPinDescriptor pinDescriptor - ): TargetPinBodyWidget(parent, std::move(pinDescriptor)) { - this->setFixedSize(PinBodyWidget::WIDTH, PinBodyWidget::HEIGHT); - this->setObjectName("target-pin-body"); - } + PinBodyWidget(QWidget* parent, Targets::TargetPinDescriptor pinDescriptor); protected: void paintEvent(QPaintEvent* event) override; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinBodyWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinBodyWidget.cpp index 67b8a771..b741a7f0 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinBodyWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinBodyWidget.cpp @@ -6,6 +6,16 @@ using namespace Bloom::Widgets::InsightTargetWidgets::Qfp; using namespace Bloom::Targets; +PinBodyWidget::PinBodyWidget(QWidget* parent, Targets::TargetPinDescriptor pinDescriptor, bool isVertical) +: TargetPinBodyWidget(parent, std::move(pinDescriptor)), isVertical(isVertical) { + if (isVertical) { + this->setFixedSize(PinBodyWidget::WIDTH, PinBodyWidget::HEIGHT); + + } else { + this->setFixedSize(PinBodyWidget::HEIGHT, PinBodyWidget::WIDTH); + } +} + void PinBodyWidget::paintEvent(QPaintEvent* event) { auto painter = QPainter(this); this->drawWidget(painter); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinBodyWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinBodyWidget.hpp index e074de7c..56bfb763 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinBodyWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinBodyWidget.hpp @@ -18,17 +18,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp static const int WIDTH = 19; static const int HEIGHT = 28; - PinBodyWidget(QWidget* parent, Targets::TargetPinDescriptor pinDescriptor, bool isVertical): - TargetPinBodyWidget(parent, std::move(pinDescriptor)), isVertical(isVertical) { - this->setObjectName("target-pin-body"); - - if (isVertical) { - this->setFixedSize(PinBodyWidget::WIDTH, PinBodyWidget::HEIGHT); - - } else { - this->setFixedSize(PinBodyWidget::HEIGHT, PinBodyWidget::WIDTH); - } - } + PinBodyWidget(QWidget* parent, Targets::TargetPinDescriptor pinDescriptor, bool isVertical); protected: void paintEvent(QPaintEvent* event) override; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.cpp index 4695130d..a8e1148a 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.cpp @@ -5,6 +5,12 @@ using namespace Bloom::Widgets::InsightTargetWidgets; using namespace Bloom::Targets; +TargetPinBodyWidget::TargetPinBodyWidget(QWidget* parent, Targets::TargetPinDescriptor pinDescriptor) +:QWidget(parent), pinDescriptor(std::move(pinDescriptor)) { + this->setObjectName("target-pin-body"); + this->setToolTip(QString::fromStdString(this->pinDescriptor.name).toUpper()); +} + QColor TargetPinBodyWidget::getBodyColor() { auto pinColor = this->defaultBodyColor; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.hpp index 1a84fc98..f00c4d25 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.hpp @@ -24,10 +24,7 @@ namespace Bloom::Widgets::InsightTargetWidgets Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true) public: - TargetPinBodyWidget(QWidget* parent, Targets::TargetPinDescriptor pinDescriptor): - QWidget(parent), pinDescriptor(std::move(pinDescriptor)) { - this->setObjectName("target-pin-body"); - } + TargetPinBodyWidget(QWidget* parent, Targets::TargetPinDescriptor pinDescriptor); void setPinState(const Targets::TargetPinState& pinState) { this->pinState = pinState;