Allow the global drawer to become a menu if desired

Authored by nicolasfella on Oct 9 2019, 12:56 PM.

Description

Allow the global drawer to become a menu if desired

Summary:
The global drawer is usually used to implement one of two patterns: As navigation or as a menu. For both cases a drawer is a suboptimal experience on the desktop, where it just looks and feels alien.

In the navigation case this is usually addressed by making the drawer always open, e.g. seen in Discover or KDE Connect.
In the menu case (e.g. seen in plasma-phonebook or Itinerary) this is not ideal since the actions are not that much important.

This patch adds a property to the global drawer that allows to morph the drawers menu content into a hamburger menu in the toolbar so it behaves more like other menus seen on the desktop.

This is opt-in for two reasons: 1) We don't want to break the navigation pattern 2) it limits the flexibility of the GlobalDrawer, as custom Items cannot be represented.

If the isMenu property is set the drawer handle is hidden on the desktop and the toolbar contains a similar looking, but differently behaving hamburger button.

Test Plan:
Tested with patched plasma-phonebook and unpatched Itinerary on Desktop and mobile

Reviewers: VDG, mart

Reviewed By: VDG, mart

Subscribers: ngraham, plasma-devel

Tags: Kirigami

Differential Revision: https://phabricator.kde.org/D24469

Details

Committed
nicolasfellaOct 9 2019, 1:22 PM
Reviewer
VDG
Differential Revision
D24469: Allow the global drawer to become a menu if desired
Parents
R169:2b7683fe9db9: Be more explicit about action property types
Branches
Unknown
Tags
Unknown