Skip to content

Commit

Permalink
Add missing 2 * faremWidth() also to WEffectParameterNameBase's m_wid…
Browse files Browse the repository at this point in the history
…thHint
  • Loading branch information
daschuer committed Feb 4, 2023
1 parent 29c3bbc commit 9ca1deb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/widget/weffectparameternamebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ void WEffectParameterNameBase::parameterUpdated() {
m_text = kNoEffectString;
setBaseTooltip(tr("No effect loaded."));
}
// frameWidth() is the maximum of the sum of margin, border and padding
// width of the left and the right side.
m_widthHint = math_max(
valueWidth,
metrics.size(0, m_text).width());
valueWidth,
metrics.size(0, m_text).width()) +
2 * frameWidth();
setText(m_text);
m_parameterUpdated = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/widget/wlabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void WLabel::setText(const QString& text) {
m_longText = text;
if (m_elideMode != Qt::ElideNone) {
QFontMetrics metrics(font());
// Measure the text for label width
// Measure the text for the optimum label width
// frameWidth() is the maximum of the sum of margin, border and padding
// width of the left and the right side.
m_widthHint = metrics.size(0, m_longText).width() + 2 * frameWidth();
Expand Down

0 comments on commit 9ca1deb

Please sign in to comment.