Skip to content

Commit

Permalink
Remove trailing linebreaks from tool tips
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergAtGithub committed Nov 30, 2024
1 parent 2c465ed commit 4d54b0d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/widget/wbasewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,20 @@ void WBaseWidget::setControlParameterRightUp(double v) {
}

void WBaseWidget::updateTooltip() {
// If we are in developer mode, update the tooltip.
// Remove leading and trailing whitespace/line breaks from the tooltip.
QString base = baseTooltip().trimmed();

// If we are in developer mode, expand the tooltip.
if (CmdlineArgs::Instance().getDeveloper()) {
QStringList debug;
fillDebugTooltip(&debug);

QString base = baseTooltip();
if (!base.isEmpty()) {
debug.append(QStringLiteral("Tooltip: \"%1\"").arg(base));
}
m_pWidget->setToolTip(debug.join(QStringLiteral("\n")));
} else {
m_pWidget->setToolTip(base);
}
}

Expand Down

0 comments on commit 4d54b0d

Please sign in to comment.