<table><tr><td style="">kossebau accepted this revision.<br />kossebau added a comment.<br />This revision is now accepted and ready to land.
</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>Some more nitpicks, but otherwise happy with this patch.<br />
So with the nitpicks resolved, I vote for adding this.</p></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83555">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ideallayout.cpp:211</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">shrink</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">int</span> <span class="n">smallItems</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">const</span> <span style="color: #aa4000">int</span> <span class="n">surplus</span> <span style="color: #aa2211">=</span> <span class="n">std</span><span style="color: #aa2211">::</span><span class="n">accumulate</span><span class="p">(</span><span class="n">_items</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">_items</span><span class="p">.</span><span class="n">end</span><span class="p">(),</span> <span style="color: #601200">0</span><span class="p">,</span> <span class="p">[</span><span class="n">maximumHeight</span><span class="p">,</span> <span style="color: #aa2211">&</span><span class="n">smallItems</span><span class="p">](</span><span style="color: #aa4000">int</span> <span class="n">acc</span><span class="p">,</span> <span class="n">QLayoutItem</span><span style="color: #aa2211">*</span> <span class="n">item</span><span class="p">)</span> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">-> <tt style="background: #ebebeb; font-size: 13px;">smallItemCount</tt>, 'count' makes it clear the variable is not a list of items.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83554">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ideallayout.cpp:213</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">const</span> <span style="color: #aa4000">int</span> <span class="n">surplus</span> <span style="color: #aa2211">=</span> <span class="n">std</span><span style="color: #aa2211">::</span><span class="n">accumulate</span><span class="p">(</span><span class="n">_items</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">_items</span><span class="p">.</span><span class="n">end</span><span class="p">(),</span> <span style="color: #601200">0</span><span class="p">,</span> <span class="p">[</span><span class="n">maximumHeight</span><span class="p">,</span> <span style="color: #aa2211">&</span><span class="n">smallItems</span><span class="p">](</span><span style="color: #aa4000">int</span> <span class="n">acc</span><span class="p">,</span> <span class="n">QLayoutItem</span><span style="color: #aa2211">*</span> <span class="n">item</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">int</span> <span class="n">h</span> <span style="color: #aa2211">=</span> <span class="n">item</span><span style="color: #aa2211">-></span><span class="n">sizeHint</span><span class="p">().</span><span class="n">height</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">h</span> <span style="color: #aa2211"><=</span> <span class="n">maximumHeight</span><span class="p">)</span> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;"><tt style="background: #ebebeb; font-size: 13px;">int h</tt> -> <tt style="background: #ebebeb; font-size: 13px;">const int itemHeight</tt> or <tt style="background: #ebebeb; font-size: 13px;">const int h</tt></p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83558">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ideallayout.cpp:222</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">Q_ASSERT</span><span class="p">(</span><span class="n">_items</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span style="color: #aa2211">!=</span> <span class="n">smallItems</span><span class="p">);</span> <span style="color: #74777d">// should be true since rect.width != sizeHint.width</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">shrinkedHeight</span> <span style="color: #aa2211">=</span> <span class="n">maximumHeight</span> <span style="color: #aa2211">+</span> <span class="n">surplus</span> <span style="color: #aa2211">/</span> <span class="p">(</span><span class="n">_items</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span style="color: #aa2211">-</span> <span class="n">smallItems</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Please add a comment to what is done here, at least sleepy code reader does not instantly get what is done here:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" 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);">// distribute surplus height over large items</pre></div></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83559">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ideallayout.cpp:268</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"> </span><span class="n"><span class="bright">x</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span class="n"><span class="bright">rect</span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span class="n"><span class="bright">x</span></span><span class="bright"></span><span class="p"><span class="bright">()</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">+</span></span><span class="bright"> </span><span class="n"><span class="bright">l</span></span><span class="bright"></span><span class="p"><span class="bright">;</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"> </span><span class="n"><span class="bright">currentLineHeight</span></span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">if</span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">shrink</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="p"><span class="bright">{</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">int</span></span><span class="bright"> </span><span class="n"><span class="bright">smallItems</span></span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">const</span> <span style="color: #aa4000">int</span> <span class="n">surplus</span> <span style="color: #aa2211">=</span> <span class="n">std</span><span style="color: #aa2211">::</span><span class="n">accumulate</span><span class="p">(</span><span class="n">_items</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">_items</span><span class="p">.</span><span class="n">end</span><span class="p">(),</span> <span style="color: #601200">0</span><span class="p">,</span> <span class="p">[</span><span class="n">maximumWidth</span><span class="p">,</span> <span style="color: #aa2211">&</span><span class="n">smallItems</span><span class="p">](</span><span style="color: #aa4000">int</span> <span class="n">acc</span><span class="p">,</span> <span class="n">QLayoutItem</span><span style="color: #aa2211">*</span> <span class="n">item</span><span class="p">)</span> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">smallItemCount</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83560">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ideallayout.cpp:270</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">const</span> <span style="color: #aa4000">int</span> <span class="n">surplus</span> <span style="color: #aa2211">=</span> <span class="n">std</span><span style="color: #aa2211">::</span><span class="n">accumulate</span><span class="p">(</span><span class="n">_items</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">_items</span><span class="p">.</span><span class="n">end</span><span class="p">(),</span> <span style="color: #601200">0</span><span class="p">,</span> <span class="p">[</span><span class="n">maximumWidth</span><span class="p">,</span> <span style="color: #aa2211">&</span><span class="n">smallItems</span><span class="p">](</span><span style="color: #aa4000">int</span> <span class="n">acc</span><span class="p">,</span> <span class="n">QLayoutItem</span><span style="color: #aa2211">*</span> <span class="n">item</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">int</span> <span class="n">w</span> <span style="color: #aa2211">=</span> <span class="n">item</span><span style="color: #aa2211">-></span><span class="n">sizeHint</span><span class="p">().</span><span class="n">width</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">w</span> <span style="color: #aa2211"><=</span> <span class="n">maximumWidth</span><span class="p">)</span> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">const</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83561">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ideallayout.cpp:282</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"> </span><span style="color: #aa4000"><span class="bright">if</span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">updateGeometry</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"> </span><span class="n"><span class="bright">item</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">-></span></span><span class="bright"></span><span class="n"><span class="bright">setGeometry</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">QRect</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">x</span></span><span class="bright"></span><span class="p"><span class="bright">,</span></span><span class="bright"> </span><span class="n"><span class="bright">y</span></span><span class="bright"></span><span class="p"><span class="bright">,</span></span> <span class="n">itemSizeHint<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span class="n"><span class="bright">width</span></span><span class="bright"></span><span class="p"><span class="bright">(),</span></span> <span class="n">item<span class="bright">S</span>izeHint<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span class="n"><span class="bright">height</span></span><span class="bright"></span><span class="p"><span class="bright">())</span>);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">for</span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">QLayoutItem</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">*</span></span><span class="bright"></span><span style="color: #a0a000"><span class="bright">item</span></span><span class="bright"> </span><span class="p"><span class="bright">:</span></span><span class="bright"> </span><span class="n"><span class="bright">_items</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="p"><span class="bright">{</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">const</span></span><span class="bright"> </span><span class="n"><span class="bright">QSize</span></span> <span class="n">itemSizeHint<span class="bright"></span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span> <span class="n">item<span class="bright"></span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">-></span></span><span class="bright"></span><span class="n"><span class="bright">s</span>izeHint<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">(</span>);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;"><tt style="background: #ebebeb; font-size: 13px;">QLayoutItem *</tt> -> QLayoutItem*`</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83562">View Inline</a><span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:1</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #74777d">/*</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Accidentally added newline? :)</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83551">View Inline</a><span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:103</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #aa4000">void</span> <span class="n">IdealToolButton</span><span style="color: #aa2211">::</span><span class="n">paintEvent</span><span class="p">(</span><span class="n">QPaintEvent</span> <span style="color: #aa2211">*</span><span class="n">event</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; "><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">_area</span> <span style="color: #aa2211">==</span> <span class="n">Qt</span><span style="color: #aa2211">::</span><span class="n">TopDockWidgetArea</span> <span style="color: #aa2211">||</span> <span class="n">_area</span> <span style="color: #aa2211">==</span> <span class="n">Qt</span><span style="color: #aa2211">::</span><span class="n">BottomDockWidgetArea</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="n">QToolButton</span><span style="color: #aa2211">::</span><span class="n">paintEvent</span><span class="p">(</span><span class="n">event</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="p">}</span> <span style="color: #aa4000">else</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span style="color: #74777d">// rotated paint</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">QStylePainter</span> <span class="n">painter</span><span class="p">(</span><span style="color: #aa4000">this</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Now that the argument event is no longer used, please add a line</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" 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);">Q_UNUSED(event);</pre></div>
<p style="padding: 0; margin: 8px;">so the compiler knows it should not complain.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83553">View Inline</a><span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:112</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">toolButtonStyle</span><span class="p">()</span> <span style="color: #aa2211">!=</span> <span class="n">Qt</span><span style="color: #aa2211">::</span><span class="n">ToolButtonTextOnly</span> <span style="color: #aa2211">&&</span> <span style="color: #aa2211">!</span><span class="n">option</span><span class="p">.</span><span class="n">icon</span><span class="p">.</span><span class="n">isNull</span><span class="p">())</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">iconWidth</span> <span style="color: #aa2211">=</span> <span class="n">option</span><span class="p">.</span><span class="n">iconSize</span><span class="p">.</span><span class="n">width</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Please wrap the single line body with {}:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" 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);">if (toolButtonStyle() != Qt::ToolButtonTextOnly && !option.icon.isNull()) {
iconWidth = option.iconSize.width();
}</pre></div></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83552">View Inline</a><span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:121</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">int</span> <span class="n">iconHeight</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">toolButtonStyle</span><span class="p">()</span> <span style="color: #aa2211">!=</span> <span class="n">Qt</span><span style="color: #aa2211">::</span><span class="n">ToolButtonTextOnly</span> <span style="color: #aa2211">&&</span> <span style="color: #aa2211">!</span><span class="n">option</span><span class="p">.</span><span class="n">icon</span><span class="p">.</span><span class="n">isNull</span><span class="p">())</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">iconHeight</span> <span style="color: #aa2211">=</span> <span class="n">option</span><span class="p">.</span><span class="n">iconSize</span><span class="p">.</span><span class="n">height</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Please wrap the single line branch body with {}:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" 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);">if (toolButtonStyle() != Qt::ToolButtonTextOnly && !option.icon.isNull()) {
iconHeight = option.iconSize.height();
}</pre></div></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15450#inline-83170">View Inline</a><span style="color: #4b4d51; font-weight: bold;">amhndu</span> wrote in <span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:46</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Although I've added this, it doesn't seem to work.</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">What exactly was the intent with this code? Given the layout code in the IdealButtonBarLayout class does not take the size policy or minimum size into account in the current logic, this would not work.</p>
<p style="padding: 0; margin: 8px;">So unless the button is going to be inserted elsewhere, this added code can be removed again, or?</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>BRANCH</strong><div><div>buttonbar-shrink</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>kossebau, kdevelop-devel, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>