Allow contextualActions to flow into the header toolbar
Summary:
This replaces the custom layouting code in ToolBarPageHeader with
an ActionToolBar, which allows items from a page's contextualActions
to flow onto the page toolbar when there is space available.
One major change is that this adds support for alignment to
ActionToolBar, which effectively rewrites the layouting code for it.
Rather than use inline hidden actions, the new code uses a separate
hidden layout to determine action visibility.
Still to do (maybe in a followup patch?):
- Add a priority property to Action that matches QAction's priority property.
- Use the priority to determine if a certain action should be shown in the toolbar at all or always kept in overflow.
- Use the priority to to replicate the icon only display behaviour used for main/left/right actions.
- Find some way for actions to indicate whether to show text at all.
Demo of functionality:
Test Plan:
Running kirigami2gallery everything should still work correctly, with
the addition of the mentioned action overflow.
However, behaviour with other applications will need to be checked,
which is the main reason this is marked as WIP.
Reviewers: Kirigami, ngraham, mart
Reviewed By: Kirigami, ngraham, mart
Subscribers: mart, ngraham, plasma-devel
Tags: Kirigami
Differential Revision: https://phabricator.kde.org/D24634