Truncated pin names in Insight window and added tooltip for access to full pin names.

This commit is contained in:
Nav
2021-06-26 03:42:16 +01:00
parent f2a4c09304
commit 8215c9e317
2 changed files with 13 additions and 5 deletions

View File

@@ -27,9 +27,15 @@ PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor,
this->pinDirectionLabel->setObjectName("target-pin-direction"); this->pinDirectionLabel->setObjectName("target-pin-direction");
this->pinDirectionLabel->setAlignment(Qt::AlignmentFlag::AlignCenter); this->pinDirectionLabel->setAlignment(Qt::AlignmentFlag::AlignCenter);
auto pinName = QString::fromStdString(pinDescriptor.name).toUpper();
this->pinNameLabel = new QLabel(this); this->pinNameLabel = new QLabel(this);
this->pinNameLabel->setObjectName("target-pin-name"); this->pinNameLabel->setObjectName("target-pin-name");
this->pinNameLabel->setText(QString::fromStdString(pinDescriptor.name).toUpper()); this->pinNameLabel->setToolTip(pinName);
if (pinName.size() > 4) {
pinName.truncate(4);
pinName.append('.');
}
this->pinNameLabel->setText(pinName);
this->pinNameLabel->setAlignment(Qt::AlignmentFlag::AlignCenter); this->pinNameLabel->setAlignment(Qt::AlignmentFlag::AlignCenter);
this->pinNumberLabel = new QLabel(this); this->pinNumberLabel = new QLabel(this);
@@ -56,4 +62,3 @@ PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor,
connect(this->bodyWidget, &PinBodyWidget::clicked, this, &TargetPinWidget::onWidgetBodyClicked); connect(this->bodyWidget, &PinBodyWidget::clicked, this, &TargetPinWidget::onWidgetBodyClicked);
} }

View File

@@ -29,10 +29,14 @@ PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor,
this->pinDirectionLabel->setObjectName("target-pin-direction"); this->pinDirectionLabel->setObjectName("target-pin-direction");
this->pinDirectionLabel->setAlignment(Qt::AlignmentFlag::AlignCenter); this->pinDirectionLabel->setAlignment(Qt::AlignmentFlag::AlignCenter);
auto pinName = QString::fromStdString(pinDescriptor.name).toUpper();
this->pinNameLabel = new QLabel(this); this->pinNameLabel = new QLabel(this);
this->pinNameLabel->setObjectName("target-pin-name"); this->pinNameLabel->setObjectName("target-pin-name");
auto pinName = QString::fromStdString(pinDescriptor.name).toUpper(); this->pinNameLabel->setToolTip(pinName);
pinName.truncate(5); if (pinName.size() > 5) {
pinName.truncate(5);
pinName.append('.');
}
this->pinNameLabel->setText(pinName); this->pinNameLabel->setText(pinName);
this->pinNameLabel->setAlignment(Qt::AlignmentFlag::AlignCenter); this->pinNameLabel->setAlignment(Qt::AlignmentFlag::AlignCenter);
@@ -95,4 +99,3 @@ PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor,
connect(this->bodyWidget, &PinBodyWidget::clicked, this, &TargetPinWidget::onWidgetBodyClicked); connect(this->bodyWidget, &PinBodyWidget::clicked, this, &TargetPinWidget::onWidgetBodyClicked);
} }