Skip to content
Snippets Groups Projects
Commit 95c8949b authored by hluk's avatar hluk
Browse files

Avoid showing horizontal scrollbar if visible items fit


Signed-off-by: default avatarLukas Holecek <hluk@email.cz>
parent fde2decf
No related branches found
No related tags found
No related merge requests found
...@@ -66,8 +66,8 @@ QSize ItemDelegate::sizeHint(const QModelIndex &index) const ...@@ -66,8 +66,8 @@ QSize ItemDelegate::sizeHint(const QModelIndex &index) const
QWidget *ww = w->widget(); QWidget *ww = w->widget();
const auto margins = m_sharedData->theme.margins(); const auto margins = m_sharedData->theme.margins();
const auto rowNumberSize = m_sharedData->theme.rowNumberSize(); const auto rowNumberSize = m_sharedData->theme.rowNumberSize();
return QSize( ww->width() + 2 * margins.width() + rowNumberSize.width(), const int width = ww->isVisible() ? ww->width() + 2 * margins.width() + rowNumberSize.width() : 0;
qMax(ww->height() + 2 * margins.height(), rowNumberSize.height()) ); return QSize( width, qMax(ww->height() + 2 * margins.height(), rowNumberSize.height()) );
} }
} }
return QSize(0, 100); return QSize(0, 100);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment