<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/120147/">https://git.reviewboard.kde.org/r/120147/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On September 11th, 2014, 10:19 p.m. UTC, <b>Aleix Pol Gonzalez</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;">Why is the component responsible for defining how it's going to be visually integrated with the host application?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Do we get to hit the scrollbar if the component doesn't have a margin and it's by the screen's border?</p></pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Why is the component responsible for defining how it's going to be visually integrated with the host application?</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Technically, the widget style is now defining how the component should appear visually, and not the component itself.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
Also, because KateView is a composite widget, it is not possibly for the host application to achieve the same (you cannot put a frame around the 'contents' only, it would have to surround the scollbars, findpanel, top and bottom message widgets, etc. </p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Also, see bug report, if no frame is rendered there is no 'native' visual indication of focus on the editable contents, even if widget style supports it, and no way (that I know of) to enforce that from the host application. </p>
<blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Do we get to hit the scrollbar if the component doesn't have a margin and it's by the screen's border?</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Depends on the widet style<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
- yes with oxygen<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
- no with breeze<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
Due to whether the style asks to draw the frame around the contents only (oxygen) or around contents+scrollbar (breeze). (QStyle::SH_ScrollView_FrameOnlyAroundContents)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This is also consistent with any QScrollAbstractArea and can be considered a bug (or regression) of the breeze style, not of the component. (I guess I'll try to adress that in breeze)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Admittingly, the current class is missing a 'setFrameStyle()' method (or something similar) to disable the frame around contents, as is the case for any QFrame.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Opinions welcome</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Hugo</p></pre>
<br />










<p>- Hugo</p>


<br />
<p>On September 11th, 2014, 9:25 p.m. UTC, Hugo Pereira Da Costa 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 KDE Frameworks and Christoph Cullmann.</div>
<div>By Hugo Pereira Da Costa.</div>


<p style="color: grey;"><i>Updated Sept. 11, 2014, 9:25 p.m.</i></p>







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


 <a href="https://bugs.kde.org/show_bug.cgi?id=158379">158379</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
ktexteditor
</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;">Short description is in title and bug report.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
The idea is to implement sunken frame in KTextEditor::View (kate, kwrite, etc.) with 'native' focus and mouse-over effects for styles that support it.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
This makes KateView look again like QTextEdit</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Some changes are needed to the layouting in order to accomodate a frame either around the contents only, or around contents+scrollbar, depending on style hint.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The detail changes are:<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
- Use QGridLayout for setting up View layout <br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
- Added QSpacerItems in order to properly implement frame around edition area. <br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
- properly account for whether style requires frame around contents only, or around contents + scrollbars <br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
- Call style primitive (CE_ShapedFrame) in order to render a frame around the said area, with proper mouse-over and focus set. <br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
- Adjust scrollbar background based on whether frame must be drawn around contents only, or scrollbars+contents <br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
- Force update of widget and scrollbars on focusIn and focusOut events</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;">Tested with Breeze, Oxygen, Virtuality, and fusion.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
The first three have focus and mouse-over effect.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
The last one does not, but still, the "correct" frame is rendered, with proper margins.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Tested in Kate, KWrite and KDevelop.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
Screenshots attached with kate.</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>src/view/kateview.h <span style="color: grey">(624072e)</span></li>

 <li>src/view/kateview.cpp <span style="color: grey">(08b4d28)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/120147/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/2014/09/11/d8a70e3b-e5ea-4fae-aeee-df073c801d86__kate-old.png">before</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/09/11/b9968e2b-9104-4022-ab7d-e89b2ce73116__kate-new-breeze.png">after (breeze)</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/09/11/1be8a8d2-053d-4002-9d83-ad2afd129042__kate-new-oxygen.png">after (oxygen)</a></li>

</ul>




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








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