<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/128201/">https://git.reviewboard.kde.org/r/128201/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On June 19th, 2016, 10:39 a.m. CEST, <b>David Faure</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/128201/diff/2/?file=469229#file469229line96" style="color: black; font-weight: bold; text-decoration: underline;">shell/progresswidget/statusbarprogresswidget.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">90</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">int</span> <span class="n">pbHeight</span> <span class="o">=</span> <span class="n">m_pProgressBar</span><span class="o">-></span><span class="n">sizeHint</span><span class="p">().</span><span class="n">height</span><span class="p">();</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Wouldn't this logic work everywhere, not just on mac?</p></pre>
 </blockquote>



 <p>On June 19th, 2016, 11:51 a.m. CEST, <b>René J.V. Bertin</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Yes, if there were only the progressbar, and that bar didn't need to show the percentage text badge (see the QtCurve and Oxygen screenshots). From what I understand that is the reason why the original code determines <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">maximumHeight</code> from the rendered text label. I have assumed that the original authors verified whether <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">m_pProgressBar->*height()</code> returns a value that takes that text label into account. I can check whether that's the case: if it doesn't then the icon and button will become very small indeed for Breeze.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Adding a pair of debug calls:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">    <span style="color: #008000; font-weight: bold">m_pProgressBar</span> <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">new</span> <span style="color: #008000; font-weight: bold">QProgressBar</span><span style="color: #666666">(</span> <span style="color: #008000; font-weight: bold">this</span> <span style="color: #666666">);</span>
    <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">installEventFilter</span><span style="color: #666666">(</span> <span style="color: #008000; font-weight: bold">this</span> <span style="color: #666666">);</span>
    <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">setMinimumWidth</span><span style="color: #666666">(</span> <span style="color: #008000; font-weight: bold">w</span> <span style="color: #666666">);</span>
    <span style="color: #008000; font-weight: bold">qDebug</span><span style="color: #666666">()</span> <span style="color: #666666"><<</span> <span style="color: #BA2121">"maximumHeight="</span> <span style="color: #666666"><<</span> <span style="color: #008000; font-weight: bold">maximumHeight</span> <span style="color: #666666"><<</span> <span style="color: #BA2121">"progBar height="</span> <span style="color: #666666"><<</span> <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">height</span><span style="color: #666666">()</span>
        <span style="color: #666666"><<</span> <span style="color: #BA2121">"sizeHint:"</span> <span style="color: #666666"><<</span> <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">sizeHint</span><span style="color: #666666">()</span> <span style="color: #666666"><<</span> <span style="color: #BA2121">"minSizeHint:"</span> <span style="color: #666666"><<</span> <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">minimumSizeHint</span><span style="color: #666666">();</span>
    <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">setMinimumHeight</span><span style="color: #666666">(</span> <span style="color: #008000; font-weight: bold">maximumHeight</span> <span style="color: #666666">);</span>
    <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">setAttribute</span><span style="color: #666666">(</span> <span style="color: #008000; font-weight: bold">Qt</span><span style="color: #666666">:</span><span style="color: #AA22FF">:WA_LayoutUsesWidgetRect</span><span style="color: #666666">,</span> <span style="color: #008000; font-weight: bold">true</span> <span style="color: #666666">);</span>
    <span style="color: #008000; font-weight: bold">qDebug</span><span style="color: #666666">()</span> <span style="color: #666666"><<</span> <span style="color: #BA2121">"new? progBar height="</span> <span style="color: #666666"><<</span> <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">height</span><span style="color: #666666">()</span>
        <span style="color: #666666"><<</span> <span style="color: #BA2121">"sizeHint:"</span> <span style="color: #666666"><<</span> <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">sizeHint</span><span style="color: #666666">()</span> <span style="color: #666666"><<</span> <span style="color: #BA2121">"minSizeHint:"</span> <span style="color: #666666"><<</span> <span style="color: #008000; font-weight: bold">m_pProgressBar-</span><span style="color: #666666">></span><span style="color: #008000; font-weight: bold">minimumSizeHint</span><span style="color: #666666">();</span>
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I get (on Linux, we already know what to do on OS X):</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">QtCurve<span style="color: #666666">:</span>
maximumHeight<span style="color: #666666">=</span> <span style="color: #666666">18</span> progBar height<span style="color: #666666">=</span> <span style="color: #666666">30</span> sizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">24)</span> minSizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">18)</span>
<span style="color: #008000; font-weight: bold">new</span><span style="color: #666666">?</span> progBar height<span style="color: #666666">=</span> <span style="color: #666666">30</span> sizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">24)</span> minSizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">18)</span>
Breeze<span style="color: #666666">:</span>
maximumHeight<span style="color: #666666">=</span> <span style="color: #666666">18</span> progBar height<span style="color: #666666">=</span> <span style="color: #666666">30</span> sizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">24)</span> minSizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">18)</span>
<span style="color: #008000; font-weight: bold">new</span><span style="color: #666666">?</span> progBar height<span style="color: #666666">=</span> <span style="color: #666666">30</span> sizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">24)</span> minSizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">18)</span>
Oxygen<span style="color: #666666">:</span>
maximumHeight<span style="color: #666666">=</span> <span style="color: #666666">18</span> progBar height<span style="color: #666666">=</span> <span style="color: #666666">30</span> sizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">24)</span> minSizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">18)</span>
<span style="color: #008000; font-weight: bold">new</span><span style="color: #666666">?</span> progBar height<span style="color: #666666">=</span> <span style="color: #666666">30</span> sizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">24)</span> minSizeHint<span style="color: #666666">:</span> QSize<span style="color: #666666">(91,</span> <span style="color: #666666">18)</span>
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">So using <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">sizeHint().height()</code> will give an apparently style-independent height indication, but the wrong one. On Linux we'd have to use <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">minimumSizeHint().height()</code> to preserve the current visual aspect or else accept that the widget will be about 50% taller (for a 10pt font; I use Segoe UI Semibold as my standard font). I think that becomes a bit too much (see the screenshot).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">We could initialise <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">maximumHeight = m_pProgressBar->minimumSizeHint().height()</code>, but we'd still have to keep the adjusting code for <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">macintosh</code>, so I'm not sure about such a change.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Also, the <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">m_pProgressBar->setMinimumHeight(maximumHeight)</code> call is apparently redundant for the 3 styles I've tested, but can we be sure that this will always be the case, for all styles and/or stylesheets?</p></pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Re: "a bit too much": with Oxygen and QtCurve the effect shown in the latest screenshot is even more in your face: the widget takes on an aspect like on OS X, = a very fat progress bar that draws more attention to itself than I find justified. With the macintosh style we just have to accept that (though I should check if there is no "mini" variant!) but I don't think we should with styles where there's choice.</p></pre>
<br />




<p>- René J.V.</p>


<br />
<p>On June 18th, 2016, 7:47 p.m. CEST, René J.V. Bertin wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDevelop and David Faure.</div>
<div>By René J.V. Bertin.</div>


<p style="color: grey;"><i>Updated June 18, 2016, 7:47 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdevplatform
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I came across this old bit of code, judging from the use of the deprecated <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">Q_OS_MAC</code> token. 
Some quick testing suggests that using <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">WA_LayoutUsesWidgetRect</code> achieves what I think is the intended effect without platform-specific code. (That platform test ought really check for using the <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">macintosh</code> widget style btw, rather than "are we running on OS X").</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">For now only on OS X, with the native theme as well as QtCurve, Breeze and Oxygen.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>shell/progresswidget/statusbarprogresswidget.cpp <span style="color: grey">(1a32ea8)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/128201/diff/" style="margin-left: 3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments </h1>


 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/16/1498e8dc-4541-473b-b6db-2c2ae138cbc3__Screen_Shot_2016-06-17_at_00.17.17.png">OS X/Mac native *without* the patch</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/17/dd352994-1753-4b33-a0d2-cd2a3132df48__progress-stock.png">stock widget under Linux (same layout using Breeze)</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/18/8e6a0761-b760-4f41-be67-7f9ba7318349__Screen_Shot_2016-06-18_at_19.21.52.png">OS X/native with the new patch</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/18/3535be4c-3034-493d-88c0-61ab9a13844d__Screen_Shot_2016-06-18_at_19.24.46.png">OS X using QtCurve with the new patch</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/18/359d5f57-bdaa-45a7-a0b0-6acb5609459f__Screen_Shot_2016-06-18_at_19.16.19.png">Linux, Breeze, new patch</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/18/f5eb0902-884a-47e5-bf84-a3581a21bece__Screen_Shot_2016-06-18_at_19.14.17.png">Linux, QtCurve, new patch</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/18/536d4f09-8409-4eb4-80ca-27d3f744d6a0__Screen_Shot_2016-06-18_at_19.16.56.png">Linux, Oxygen, new patch</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/19/ee2d687e-69ea-493f-9ae4-87d90be614e2__progress-patched-breeze.png">Linux, Breeze + Breeze icons, new patch</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/19/7e3cfc5c-cb80-491c-b4d2-4d6f9c839a48__progress-patched-qtcurve.png">Linux, QtCurve + Breeze icons, new patch</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/06/19/0b10d97d-3ba6-4d05-a663-3a03e29bc1c9__progress-patched-oxygen.png">Linux,Oxygen+Breeze icons, new patch</a></li>

</ul>




  </td>
 </tr>
</table>







  </div>
 </body>
</html>