Fix compact mode not filling all available space

This seems to be an unintentional change in compact mode caused by 054f87cae2,
where an if check for "straight line" or "fill width" mode ended up
being removed. But this was needed for availableWidth() to return the
correct width for compact mode, otherwise it got weirdly centered and
ended up with a limited width.
This commit is contained in:
Joshua Goins
2025-08-30 15:10:29 -04:00
parent 385fafa51c
commit 9412f7e189

View File

@@ -186,6 +186,10 @@ int DelegateSizeHelper::availablePercentageWidth() const
qreal DelegateSizeHelper::availableWidth() const
{
qreal absoluteWidth = maxAvailableWidth() * availablePercentageWidth() * 0.01;
// We want to use all available space for a horizontal line.
if (m_startPercentWidth == m_endPercentWidth) {
return std::round(absoluteWidth);
}
return std::round(std::min(absoluteWidth, maxWidth()));
}