Review Request 119879: call style()->drawControl rather than drawItemText to handle button painting in kmultitabbar

Hugo Pereira Da Costa hugo.pereira at free.fr
Thu Aug 21 11:41:46 UTC 2014



> On Aug. 21, 2014, 10:42 a.m., Christoph Feck wrote:
> > Regarding rotating the complete button, I doubt that it will look good. You will also rotate lightning/shadows, direction of gradients etc.

yes, right ... 
in fact, what my own code does (after double checking), is call CE_ToolButtonLabel for both the text and icon at once. (with rotated icon). It leaves the panel rendering unrotated. 
this still save you all the metrics computation.


- Hugo


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


On Aug. 21, 2014, 10:19 a.m., Hugo Pereira Da Costa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119879/
> -----------------------------------------------------------
> 
> (Updated Aug. 21, 2014, 10:19 a.m.)
> 
> 
> Review request for KDE Frameworks, Christoph Feck, Gilles Caulier, and Marko Käning.
> 
> 
> Repository: kwidgetsaddons
> 
> 
> Description
> -------
> 
> As said in the title ...
> 
> This is needed for styles that would do more fancy things, such as, change the color (breeze), add a shadow (mac) or what else (change the font, etc.)
> 
> Now thinking more about it:
> all this paintEvent stuff is needed to handle rotated (vertical) buttons. one could make it much simpler by: 
> - rotate the painter once and for all in one direction
> - rotate the pixmap in the other direction
> 
> Call directly drawComplexControl( CC_ToolButton )
> (instead of the 'sub' drawContal calls)
> 
> That would deal automatically with the options, spacing, margins, etc. in one go.
> 
> In fact I have a custom class here that does just that. 
> Should I implement and test, instead of the fix above ?
> 
> This would also have a good chance to fix bug 296810
> 
> 
> Diffs
> -----
> 
>   src/kmultitabbar.cpp 7af343b 
> 
> Diff: https://git.reviewboard.kde.org/r/119879/diff/
> 
> 
> Testing
> -------
> 
> looks good with breeze, oxygen, fusion
> 
> 
> Thanks,
> 
> Hugo Pereira Da Costa
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140821/8d9e8d6a/attachment.html>


More information about the Kde-frameworks-devel mailing list