Skip to content

Commit

Permalink
MultiLineEditDelegate: don't let the editor shrink smaller than the o…
Browse files Browse the repository at this point in the history
…riginal height

when returning to single-line mode after removing a line break
  • Loading branch information
ronso0 committed Jul 23, 2023
1 parent 1b657a0 commit ba7f5b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/library/multilineeditdelegate.cpp
Expand Up @@ -96,7 +96,8 @@ void MultiLineEditDelegate::adjustEditor(MultiLineEditor* pEditor, const QSizeF
lines += lines > 1 ? 1 : 0;

QFontMetrics fm(pEditor->document()->defaultFont());
int newH = fm.lineSpacing() * lines;
// Don't let the editor shrink smaller than the original height
int newH = std::max(fm.lineSpacing() * lines, m_editRect.height());

// Limit editor to visible table height
int tableH = m_pTableView->viewport()->rect().height();
Expand Down

0 comments on commit ba7f5b6

Please sign in to comment.