Commit f0444f60 authored by Henrik Fehlauer's avatar Henrik Fehlauer

Fix indentation of icon for left aligned toolbuttons

Summary:
Gwenview's {nav Operations} sidebar uses custom `QToolButtons` which are
wide and left aligned. Special support for this in Breeze was added with
2fb62271. However, compared to the KDE4 version there is not enough space
between the left button border and the icon:

{F5539728}

This is fixed by adding the appropriate margin:

{F5539730}

Note how this replicates exactly the spacing of the toolbuttons in the
regular toolbar on the top (which had its icon size set to "small" in
this screenshot).

CCBUG: 381535

Test Plan:
Icons on toolbuttons in Gwenview's {nav Operations} sidebar no longer
squished all the way to the left, text spacing still looking good.

Reviewers: hpereiradacosta

Reviewed By: hpereiradacosta

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9281
parent 87497834
......@@ -4307,7 +4307,10 @@ namespace Breeze
} else {
const bool leftAlign( widget && widget->property( PropertyNames::toolButtonAlignment ).toInt() == Qt::AlignLeft );
if( leftAlign ) iconRect = QRect( QPoint( contentsRect.left(), contentsRect.top() + (contentsRect.height() - iconSize.height())/2 ), iconSize );
if( leftAlign ) {
const int marginWidth( Metrics::Button_MarginWidth + Metrics::Frame_FrameWidth + 1 );
iconRect = QRect( QPoint( contentsRect.left() + marginWidth, contentsRect.top() + (contentsRect.height() - iconSize.height())/2 ), iconSize );
}
else {
const int contentsWidth( iconSize.width() + textSize.width() + Metrics::ToolButton_ItemSpacing );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment