<table><tr><td style="">rjvbb added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15450">View Revision</a></tr></table><br /><div><div><p>No, I haven't pushed a fix, but I have one which seems to work just fine. Feel free to clean it up as you see fit (I see an accidental indentation change) and push it yourself.</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="diff" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span style="color: #000080">diff --git kdevplatform/sublime/ideallayout.cpp kdevplatform/sublime/ideallayout.cpp</span>
<span style="color: #000080">index 8bc43479197dfb1b018b780c116034c3f1fc7e69..5976a2c5b31aef60b9f7e49ea5560330a0531cba 100644</span>
<span style="color: #a00000">--- kdevplatform/sublime/ideallayout.cpp</span>
<span style="color: #00a000">+++ kdevplatform/sublime/ideallayout.cpp</span>
<span style="color: #800080">@@ -202,12 +202,12 @@ int IdealButtonBarLayout::doVerticalLayout(const QRect &rect, bool updateGeometr</span>
return x + currentLineWidth + r;
}
<span style="color: #a00000">- const bool shrink = rect.height() < sizeHint().height();</span>
<span style="color: #00a000">+ bool shrink = rect.height() < sizeHint().height();</span>
const int maximumHeight = rect.height() / _items.size();
int shrinkedHeight = -1;
<span style="color: #a00000">- if (shrink) {</span>
<span style="color: #00a000">+ if (shrink ) {</span>
int smallItemCount = 0;
const int surplus = std::accumulate(_items.begin(), _items.end(), 0, [maximumHeight, &smallItemCount](int acc, QLayoutItem* item) {
const int itemHeight = item->sizeHint().height();
<span style="color: #800080">@@ -218,9 +218,13 @@ int IdealButtonBarLayout::doVerticalLayout(const QRect &rect, bool updateGeometr</span>
return acc;
});
<span style="color: #a00000">- Q_ASSERT(_items.size() != smallItemCount); // should be true since rect.width != sizeHint.width</span>
<span style="color: #a00000">- // evenly distribute surplus height over large items</span>
<span style="color: #a00000">- shrinkedHeight = maximumHeight + surplus / (_items.size() - smallItemCount);</span>
<span style="color: #00a000">+ if (_items.size() != smallItemCount) {</span>
<span style="color: #00a000">+ // evenly distribute surplus height over large items</span>
<span style="color: #00a000">+ shrinkedHeight = maximumHeight + surplus / (_items.size() - smallItemCount);</span>
<span style="color: #00a000">+ } else {</span>
<span style="color: #00a000">+ // Only small items, no shrinkage needed</span>
<span style="color: #00a000">+ shrink = false;</span>
<span style="color: #00a000">+ }</span>
}
for (QLayoutItem* item : _items) {
<span style="color: #800080">@@ -260,7 +264,7 @@ int IdealButtonBarLayout::doHorizontalLayout(const QRect &rect, bool updateGeome</span>
return y + currentLineHeight + b;
}
<span style="color: #a00000">- const bool shrink = rect.width() < sizeHint().width();</span>
<span style="color: #00a000">+ bool shrink = rect.width() < sizeHint().width();</span>
const int maximumWidth = rect.width() / _items.size();
int shrinkedWidth = -1;
<span style="color: #800080">@@ -276,9 +280,12 @@ int IdealButtonBarLayout::doHorizontalLayout(const QRect &rect, bool updateGeome</span>
return acc;
});
<span style="color: #a00000">- Q_ASSERT(_items.size() != smallItemCount); // should be true since rect.width != sizeHint.width</span>
<span style="color: #a00000">- // evenly distribute surplus width on the large items</span>
<span style="color: #a00000">- shrinkedWidth = maximumWidth + surplus / (_items.size() - smallItemCount);</span>
<span style="color: #00a000">+ if (_items.size() != smallItemCount) {</span>
<span style="color: #00a000">+ // evenly distribute surplus height over large items</span>
<span style="color: #00a000">+ shrinkedWidth = maximumWidth + surplus / (_items.size() - smallItemCount);</span>
<span style="color: #00a000">+ } else {</span>
<span style="color: #00a000">+ shrink = false;</span>
<span style="color: #00a000">+ }</span>
}
for (QLayoutItem* item : _items) {</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15450">https://phabricator.kde.org/D15450</a></div></div><br /><div><strong>To: </strong>amhndu, KDevelop, kossebau<br /><strong>Cc: </strong>rjvbb, kossebau, kdevelop-devel, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>