Allow the global drawer to become a menu if desired
ClosedPublic

Authored by nicolasfella on Oct 7 2019, 1:40 PM.

Details

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

Diff Detail

Repository
R169 Kirigami
Branch
toolbarmenu
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17399
Build 17417: arc lint + arc unit
nicolasfella created this revision.Oct 7 2019, 1:40 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptOct 7 2019, 1:40 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
nicolasfella requested review of this revision.Oct 7 2019, 1:40 PM
ngraham added a subscriber: ngraham.Oct 7 2019, 1:42 PM

Nice, anything that improves convergence by makes Kirigami apps feel more at home on the desktop is a good thing in my mind. :)

nicolasfella edited the test plan for this revision. (Show Details)Oct 7 2019, 1:44 PM
  • Rename property
mart accepted this revision.Oct 8 2019, 1:28 PM

conceptually i like it.
I would like positioning the menu right under the button and having the button looking pressed as long as the menu is open (like the ... button does)

src/controls/GlobalDrawer.qml
221

@since 2.11

src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
72

x: 0
y: menuButton.height ?

This revision is now accepted and ready to land.Oct 8 2019, 1:28 PM
mart requested changes to this revision.Oct 8 2019, 1:28 PM
This revision now requires changes to proceed.Oct 8 2019, 1:28 PM
mart added inline comments.Oct 8 2019, 1:30 PM
src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
60

try using PrivateActiontoolbutton, it should give the complete correct behavior for free

  • Rename property
  • Use privateActionToolbutton
nicolasfella marked 3 inline comments as done.Oct 9 2019, 12:54 PM
  • Remove unused import
mart accepted this revision.Oct 9 2019, 1:22 PM
This revision is now accepted and ready to land.Oct 9 2019, 1:22 PM
This revision was automatically updated to reflect the committed changes.