<table><tr><td style="">broulik created this revision.<br />broulik added a reviewer: Plasma.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />broulik requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D28116">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p><tt style="background: #ebebeb; font-size: 13px;">KQuickStyleItem</tt> manages its implicit size internally. Overriding it on the QML side makes this non-deterministic which assignment wins and might cause unexpected re-evaluation of the size causing it to change.<br />
Moreover, the check indicator size already includes spacing between checkbox and label on the <tt style="background: #ebebeb; font-size: 13px;">QStyle</tt> side, so our additional <tt style="background: #ebebeb; font-size: 13px;">spacing</tt> would be added ontop. Furthermore, <tt style="background: #ebebeb; font-size: 13px;">CheckBox</tt> <tt style="background: #ebebeb; font-size: 13px;">padding</tt> appears to add padding around the control as a whole /and/ between checkbox and label, further widening the gap between the two.<br />
Finally, because of the right padding of the <tt style="background: #ebebeb; font-size: 13px;">CheckIndicator</tt>, assigning its <tt style="background: #ebebeb; font-size: 13px;">height</tt> to its <tt style="background: #ebebeb; font-size: 13px;">width</tt> makes it a lot taller than it should be, resulting in large gaps between controls in e.g. a <tt style="background: #ebebeb; font-size: 13px;">FormLayout</tt>.</p>

<p>BUG: 418447</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>The only downside might be that using a <tt style="background: #ebebeb; font-size: 13px;">CheckIndicator</tt> standalone now has a quite small size (just the checkbox you see basically) rather than a "nice delegate like height". But then I don't think this control is being used anywhere, and is probably centered vertically anway. When used in conjunction with <tt style="background: #ebebeb; font-size: 13px;">ItemDelegate</tt> (checkable item delegate) I believe the entire delegate becomes clickable to toggle the <tt style="background: #ebebeb; font-size: 13px;">CheckBox</tt> so it getting smaller should have no effect.</p>

<p>Before:<br />
<a href="https://phabricator.kde.org/F8182462" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F8182462: Screenshot_20200318_090022.png</a><br />
After:<br />
<a href="https://phabricator.kde.org/F8182463" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F8182463: Screenshot_20200318_090005.png</a><br />
The gap is still ever so slightly wider than in a <tt style="background: #ebebeb; font-size: 13px;">QCheckBox</tt> but that appears to be the style taking into account the "empty label" which still might have some font lead in/out.</p>

<p>Edit: Just as I was uploading this, I realized that the spacing is now non-existant with styles other than Breeze ... so I'll have to do some more research on how it gets the sizing :(</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R858 Qt Quick Controls 2: Desktop Style</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28116">https://phabricator.kde.org/D28116</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>org.kde.desktop/CheckBox.qml<br />
org.kde.desktop/CheckIndicator.qml<br />
org.kde.desktop/RadioButton.qml</div></div></div><br /><div><strong>To: </strong>broulik, Plasma<br /><strong>Cc: </strong>plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>