<table><tr><td style="">broulik added inline comments.
</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/D3706" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14693" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">appmenuapplet.cpp:91</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="n">ctx</span><span style="color: #aa2211">-></span><span class="n">window</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">mouseGrabberItem</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">ungrabMouse</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Somehow your indentation is a bit off?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14683" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">configGeneral.qml:44</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">id: fullRepresentationRadio</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">text:</span> <span style="color: #004012">i18n</span><span class="p">(</span><span style="color: #766510">"Full Representation"</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">exclusiveGroup:</span> <span style="color: #004012">representationGroup</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Not too happy with the naming here. The old applet just had a checkbox for "Use single button" for menu or something like that, that would also simplify the settings page a lot ;)</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14682" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">configGeneral.qml:56</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #004012">plasmoid</span><span class="p">.</span><span style="color: #004012">configuration</span><span class="p">.</span><span style="color: #004012">fullRepresentation</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #004012">fullRepresentationRadio</span><span class="p">.</span><span style="color: #004012">checked</span> <span style="color: #aa2211">=</span> <span style="color: #000a65">true</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span> <span style="color: #aa4000">else</span> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I *think* you can just in the ExclusiveGroup above bind to the "current" property:</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);">Controls.ExclusiveGroup {
id: representationGroup
current: plasmoid.configuration.fullRepresentation ? fullRepresentationRadio : compactRepresentationRadio
}</pre></div>
<p style="padding: 0; margin: 8px;">or you could perhaps just bind "checked" in the RadioButtons</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);">checked: plasmoid.configuration.fullRepresentation</pre></div></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14692" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.qml:25</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"><span style="color: #304a96">import</span> <span style="color: #004012">org</span><span class="p">.</span><span style="color: #004012">kde</span><span class="p">.</span><span style="color: #004012">plasma</span><span class="p">.</span><span style="color: #004012">components</span> <span style="color: #601200">2.0</span> <span style="color: #004012">as</span> <span style="color: #004012">PlasmaComponents</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"><span style="color: #304a96">import</span> <span style="color: #004012">org</span><span class="p">.</span><span style="color: #004012">kde</span><span class="p">.</span><span style="color: #004012">plasma</span><span class="p">.</span><span style="color: #304a96">private</span><span class="p">.</span><span style="color: #004012">appmenu</span> <span style="color: #601200">1.0</span> <span style="color: #004012">as</span> <span style="color: #004012">AppMenuPrivate</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Can you perhaps look into making it a c++ applet rather than using a private import – we somewhat try to get away from this</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14689" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.qml:37-38</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">Layout.minimumWidth:</span> <span style="color: #004012">units</span><span class="p">.</span><span style="color: #004012">iconSizes</span><span class="p">.</span><span style="color: #004012">large</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">Layout.minimumHeight:</span> <span style="color: #004012">units</span><span class="p">.</span><span style="color: #004012">iconSizes</span><span class="p">.</span><span style="color: #004012">large</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Perhaps base that on font size (or just units.gridUnit)</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14684" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.qml:42</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">Plasmoid.compactRepresentation:</span> <span style="color: #004012">Component</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #004012">PlasmaComponents</span><span class="p">.</span><span style="color: #004012">ToolButton</span> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I don't think this needs to be wrapped in Component</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14685" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.qml:43</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">Plasmoid.compactRepresentation:</span> <span style="color: #004012">Component</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #004012">PlasmaComponents</span><span class="p">.</span><span style="color: #004012">ToolButton</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">Layout.fillWidth:</span> <span style="color: #004012">root</span><span class="p">.</span><span style="color: #004012">vertical</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Also, I find it pretty cool that you just use compact and full rep for that :) I would not have thought of that</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14686" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.qml:67-73</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">var</span> <span style="color: #004012">count</span> <span style="color: #aa2211">=</span> <span style="color: #004012">buttonRepeater</span><span class="p">.</span><span style="color: #004012">count</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">var</span> <span style="color: #004012">idx</span> <span style="color: #aa2211">=</span> <span style="color: #004012">index</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #004012">idx</span> <span style="color: #aa2211">>=</span> <span style="color: #004012">count</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #004012">idx</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span> <span style="color: #aa4000">else</span> <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #004012">idx</span> <span style="color: #aa2211"><</span> <span style="color: #601200">0</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #004012">idx</span> <span style="color: #aa2211">=</span> <span style="color: #004012">count</span> <span style="color: #aa2211">-</span> <span style="color: #601200">1</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><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);">var idx = Math.max(0, Math.min(buttonRepeater.count - 1, index))</pre></div>
<p style="padding: 0; margin: 8px;">(too bad there's no qBound in QML)</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14688" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.qml:77</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #004012">button</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #004012">plasmoid</span><span class="p">.</span><span style="color: #004012">nativeInterface</span><span class="p">.</span><span style="color: #004012">trigger</span><span class="p">(</span><span style="color: #004012">button</span><span class="p">,</span> <span style="color: #004012">button</span><span class="p">.</span><span style="color: #004012">buttonData</span><span class="p">,</span> <span style="color: #004012">idx</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">You could just do button.clicked() which will end up executing the onClicked below instead of duplicating the logic here</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D3706#inline-14687" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.qml:88</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #004012">readonly</span> <span style="color: #004012">property</span> <span style="color: #304a96">int</span> <span style="color: #aa4000">buttonIndex:</span> <span style="color: #004012">index</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: #d0ffd0;"> <span style="color: #004012">readonly</span> <span style="color: #004012">property</span> <span style="color: #aa4000">var</span> <span style="color: #aa4000">buttonData:</span> <span style="color: #004012">activeActions</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">buttonData is pretty generic of a name</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3706" rel="noreferrer">https://phabricator.kde.org/D3706</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>chinmoyr, Plasma, broulik<br /><strong>Cc: </strong>plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas<br /></div>