[RFC] [Active Window Control] Elide appmenu when it is too long
Needs ReviewPublic

Authored by Pitel on Mar 5 2018, 9:11 PM.

Details

Reviewers
martinkostolny
Group Reviewers
Plasma
Summary

When appmenu is too large to fit in and "»" button instead of overflowing.

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.

Diff Detail

Repository
R884 Active Window Control Applet for Plasma
Lint
Lint Skipped
Unit
Unit Tests Skipped
Pitel created this revision.Mar 5 2018, 9:11 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 5 2018, 9:11 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
Pitel requested review of this revision.Mar 5 2018, 9:11 PM
mart added a subscriber: mart.Mar 23 2018, 1:52 PM

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