<table><tr><td style="">filipf created this revision.<br />Herald added a project: Frameworks.<br />Herald added a subscriber: kde-frameworks-devel.<br />filipf 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/D29740">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>We have two interfering button background items right now:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">surfaceNormal when it has activeFocus and is using using the "focus-background" item</li>
<li class="remarkup-list-item">surfacePressed</li>
</ul>
<p>After a button is pressed surfacePressed correctly disappears but surfaceNormal remains in the "focus-background" state, thereby making the button still look pressed.</p>
<p>The problem is that the button still has activeFocus even after a press.</p>
<p>To solve this we switch the "focus-background" to only show up on visualFocus. Per Qt documentation on visual Focus:<br />
"In general, for visualizing key focus, this property is preferred over Item::activeFocus. This ensures that key focus is only visualized when interacting with keys - not when interacting via touch or mouse."</p>
<p>Given that we have surfacePressed for focus accomplished with a mouse or touch, visualFocus will only detect tabbing and therefore the button no longer remains pressed after a press and behaves like its PC2 counterpart.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R242 Plasma Framework (Library)</div></div></div><br /><div><strong>BRANCH</strong><div><div>dont-remain-pressed (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29740">https://phabricator.kde.org/D29740</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/declarativeimports/plasmacomponents3/Button.qml</div></div></div><br /><div><strong>To: </strong>filipf<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns<br /></div>