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

2018-03-23 Thread Marco Martin
mart added a comment.


  we are starting to use more the "overflow-menu" icon for this use case

REPOSITORY
  R884 Active Window Control Applet for Plasma

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

To: Pitel, #plasma, martinkostolny
Cc: mart, plasma-devel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, 
abetts, sebas, apol


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

2018-03-05 Thread Radek Hušek
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 

  
  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 
.)
  
  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 
.

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