D11073: [RFC] [Active Window Control] Elide appmenu when it is too long

Radek Hušek noreply at phabricator.kde.org
Mon Mar 5 21:11:15 UTC 2018


Pitel created this revision.
Pitel added reviewers: Plasma, martinkostolny.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.
Pitel requested review of this revision.

REVISION SUMMARY
  When appmenu is too large to fit in and "»" button instead of overflowing.
  
  F5742423: Screenshot_20180305_215938.png <https://phabricator.kde.org/F5742423>
  
  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.
  
  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 (`fixOverflow` function). Property `effectiveWidth` 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 D11071: [RFC] [Active Window Control] Allow global menu be left alligned with buttons on right <https://phabricator.kde.org/D11071>.)
  
  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).
  
  This patch was only tested on top of D11071: [RFC] [Active Window Control] Allow global menu be left alligned with buttons on right <https://phabricator.kde.org/D11071>.

REPOSITORY
  R884 Active Window Control Applet for Plasma

REVISION DETAIL
  https://phabricator.kde.org/D11073

AFFECTED FILES
  lib/appmenuapplet.cpp
  package/contents/ui/AppMenu.qml

To: Pitel, #plasma, martinkostolny
Cc: plasma-devel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180305/8752617e/attachment.html>


More information about the Plasma-devel mailing list