Review Request 120147: Add frame arount KTextEditor::View, with proper handling of focus and mouse over, for widget themes that support it

Aleix Pol Gonzalez aleixpol at kde.org
Fri Sep 12 09:00:31 UTC 2014



> On Sept. 11, 2014, 10:19 p.m., Aleix Pol Gonzalez wrote:
> > Why is the component responsible for defining how it's going to be visually integrated with the host application?
> > 
> > Do we get to hit the scrollbar if the component doesn't have a margin and it's by the screen's border?
> 
> Hugo Pereira Da Costa wrote:
>     > Why is the component responsible for defining how it's going to be visually integrated with the host application?
>     
>     Technically, the widget style is now defining how the component should appear visually, and not the component itself.
>     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. 
>     
>     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. 
>     
>     > Do we get to hit the scrollbar if the component doesn't have a margin and it's by the screen's border?
>     
>     Depends on the widet style
>     - yes with oxygen
>     - no with breeze
>     Due to whether the style asks to draw the frame around the contents only (oxygen) or around contents+scrollbar (breeze). (QStyle::SH_ScrollView_FrameOnlyAroundContents)
>     
>     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)
>     
>     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.
>     
>     Opinions welcome
>     
>     Hugo

I like the reasoning, thanks for explaining Hugo! :)


- Aleix


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120147/#review66298
-----------------------------------------------------------


On Sept. 11, 2014, 9:25 p.m., Hugo Pereira Da Costa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120147/
> -----------------------------------------------------------
> 
> (Updated Sept. 11, 2014, 9:25 p.m.)
> 
> 
> Review request for KDE Frameworks and Christoph Cullmann.
> 
> 
> Bugs: 158379
>     https://bugs.kde.org/show_bug.cgi?id=158379
> 
> 
> Repository: ktexteditor
> 
> 
> Description
> -------
> 
> Short description is in title and bug report.
> 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.
> This makes KateView look again like QTextEdit
> 
> 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.
> 
> The detail changes are:
> - Use QGridLayout for setting up View layout 
> - Added QSpacerItems in order to properly implement frame around edition area. 
> - properly account for whether style requires frame around contents only, or around contents + scrollbars 
> - Call style primitive (CE_ShapedFrame) in order to render a frame around the said area, with proper mouse-over and focus set. 
> - Adjust scrollbar background based on whether frame must be drawn around contents only, or scrollbars+contents 
> - Force update of widget and scrollbars on focusIn and focusOut events
> 
> 
> Diffs
> -----
> 
>   src/view/kateview.h 624072e 
>   src/view/kateview.cpp 08b4d28 
> 
> Diff: https://git.reviewboard.kde.org/r/120147/diff/
> 
> 
> Testing
> -------
> 
> Tested with Breeze, Oxygen, Virtuality, and fusion.
> The first three have focus and mouse-over effect.
> The last one does not, but still, the "correct" frame is rendered, with proper margins.
> 
> Tested in Kate, KWrite and KDevelop.
> Screenshots attached with kate.
> 
> 
> File Attachments
> ----------------
> 
> before
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/09/11/d8a70e3b-e5ea-4fae-aeee-df073c801d86__kate-old.png
> after (breeze)
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/09/11/b9968e2b-9104-4022-ab7d-e89b2ce73116__kate-new-breeze.png
> after (oxygen)
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/09/11/1be8a8d2-053d-4002-9d83-ad2afd129042__kate-new-oxygen.png
> 
> 
> Thanks,
> 
> Hugo Pereira Da Costa
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140912/7b91376c/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list