Review Request 119898: Fix sizeHint for IdealToolButton

Hugo Pereira Da Costa hugo.pereira at free.fr
Fri Aug 22 13:47:36 UTC 2014



> On Aug. 22, 2014, 12:19 p.m., Kevin Funk wrote:
> > Could you show us some screenshots? Before/After? Where did you see issues with the current versions?

As a matter of fact, you could simply use: 

    ensurePolished();
    QSize size( QToolButton::sizeHint() );
    if (orientation() == Qt::Vertical) return size.transposed();
    else return size;

(just tested that it also works)

That would be the most robust, simple, and still be consistent with what is done in ::paintEvent
Tell me if you want me to change the review accordingly


- Hugo


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


On Aug. 22, 2014, 1:27 p.m., Hugo Pereira Da Costa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119898/
> -----------------------------------------------------------
> 
> (Updated Aug. 22, 2014, 1:27 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> As title says:
> use sizeFromContents from style rather than fixed spacing and margin, to get the correct size hint. This is similar to what is done in QToolButton and fixes truncated text for styles that add extra spacing (consistently with sizeFromContents) when rendering toolbuttons (this is the case for breeze)
> 
> Note: this also removes a "FIXME" comment
> 
> 
> Diffs
> -----
> 
>   sublime/idealtoolbutton.cpp abecdca 
> 
> Diff: https://git.reviewboard.kde.org/r/119898/diff/
> 
> 
> Testing
> -------
> 
> Tested with oxygen, breeze and fusion.
> 
> 
> File Attachments
> ----------------
> 
> kdevelop-before.png
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/08/22/352aa1d1-84d1-4fa2-8e01-3f5a8e33e9db__kdevelop-before.png
> kdevelop-after.png
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/08/22/beaeb568-f2f8-440c-a4e8-101e1e6c1499__kdevelop-after.png
> 
> 
> Thanks,
> 
> Hugo Pereira Da Costa
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140822/1e884ecb/attachment.html>


More information about the KDevelop-devel mailing list