Added tooltips to pin body widgets and moved constructors to implementation files
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user