<table><tr><td style="">Zren added a comment.
</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/D4751" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>I'm using the default DPI of 96. <tt style="background: #ebebeb; font-size: 13px;">PlasmaExtras.Heading { level: 5 }</tt> is what's controlling the RowLayout height.<br />
Level 5 is just the <tt style="background: #ebebeb; font-size: 13px;">theme.defaultFont.pointSize</tt> <a href="https://github.com/KDE/plasma-framework/blob/master/src/declarativeimports/plasmaextracomponents/qml/Heading.qml#L64" class="remarkup-link" target="_blank" rel="noreferrer">https://github.com/KDE/plasma-framework/blob/master/src/declarativeimports/plasmaextracomponents/qml/Heading.qml#L64</a><br />
Which is pointSize=10 for me <tt style="background: #ebebeb; font-size: 13px;">qml: onPointSizeChanged 10</tt><br />
Which is calculated as pixelSize=13 <tt style="background: #ebebeb; font-size: 13px;">qml: onPixelSizeChanged 13</tt> at 96 dpi<br />
In practice, the IconItem ends up 15px tall, since you use <tt style="background: #ebebeb; font-size: 13px;">Layout.maximumHeight: parent.height * 0.85</tt><br />
<tt style="background: #ebebeb; font-size: 13px;">PlasmaCore.IconItem.onMaximumHeightChanged Layout.maximumHeight=15.299999999999999 height=15.649999999999999</tt></p>
<p>Using 100% height gives an 18px tall icon</p>
<p><a href="https://phabricator.kde.org/F2593761" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">F2593761: 2017-02-24___10-31-56.png</a></p>
<p>Using ToolButton like so had a height of 30px, which causes a lot of whitespace.</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">PlasmaComponents.ToolButton {
iconName: "application-menu"
onClicked: contextMenu.show(x, y + height)
onHeightChanged: console.log('onHeightChanged', height)
}</pre></div>
<p><a href="https://phabricator.kde.org/F2593753" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">F2593753: 2017-02-24___10-30-35.png</a></p>
<p>Using <tt style="background: #ebebeb; font-size: 13px;">Layout.maximumHeight: parent.height</tt> on the ToolButton will make it 18px tall, but will also make the icon tiny by default (because it keeps the padding). We can bypass this by anchoring a child IconItem.</p>
<p>We should probably look at <a href="https://github.com/KDE/plasma-framework/blob/master/src/declarativeimports/plasmastyle/ToolButtonStyle.qml#L68" class="remarkup-link" target="_blank" rel="noreferrer">ToolButtonStyle.qml</a> to make sure we apply all the right effects to the icon. All I see is that we need to set <tt style="background: #ebebeb; font-size: 13px;">action: parent.hovered</tt> and the colorGroup.</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">PlasmaComponents.ToolButton {
Layout.maximumHeight: parent.height
onClicked: contextMenu.show(x, y + height)
PlasmaCore.IconItem {
anchors.fill: parent
source: "application-menu"
// From ToolButtonStyle.qml
active: parent.hovered
colorGroup: parent.hovered || !parent.flat ? PlasmaCore.Theme.ButtonColorGroup : PlasmaCore.ColorScope.colorGroup
}
}</pre></div>
<p><a href="https://phabricator.kde.org/F2593808" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">F2593808: 2017-02-24___10-47-29.png</a></p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R115 Plasma Audio Volume Applet</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D4751" rel="noreferrer">https://phabricator.kde.org/D4751</a></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>subdiff, Plasma, drosca, Zren<br /><strong>Cc: </strong>broulik, plasma-devel, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol<br /></div>