<table><tr><td style="">Pitel created this revision.<br />Pitel added reviewers: Plasma, martinkostolny.<br />Restricted Application added a project: Plasma.<br />Restricted Application added a subscriber: plasma-devel.<br />Pitel 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/D11073">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>When appmenu is too large to fit in and "ยป" button instead of overflowing.</p>

<p><a href="https://phabricator.kde.org/F5742423" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F5742423: Screenshot_20180305_215938.png</a></p>

<p>There is a change to C++ backend -- button indexes -10 and lower mean a drop down menu which contains some suffix of menubar items -- -10 contains them all, -11 all without first one and so on.</p>

<p>The tricky part is to determine which items to hide -- current approach is to draw all at first and then iterate through them and hide ones too much on right (<tt style="background: #ebebeb; font-size: 13px;">fixOverflow</tt> function). Property <tt style="background: #ebebeb; font-size: 13px;">effectiveWidth</tt> calculates how much space we can use and is only correct when buttons are on right and should not be overlapped by the menu. (Should be resolved after <a href="https://phabricator.kde.org/D11071" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D11071: [RFC] [Active Window Control] Allow global menu be left alligned with buttons on right</a>.)</p>

<p>If the backend changes and hiding logic are considered sane, it might be worth porting to Global Menu applet (there the computation of available space would be much simplier).</p>

<p>This patch was only tested on top of <a href="https://phabricator.kde.org/D11071" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D11071: [RFC] [Active Window Control] Allow global menu be left alligned with buttons on right</a>.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R884 Active Window Control Applet for Plasma</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11073">https://phabricator.kde.org/D11073</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>lib/appmenuapplet.cpp<br />
package/contents/ui/AppMenu.qml</div></div></div><br /><div><strong>To: </strong>Pitel, Plasma, martinkostolny<br /><strong>Cc: </strong>plasma-devel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>