Allow the global drawer to become a menu if desired
ClosedPublic

Authored by nicolasfella on Mon, Oct 7, 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nicolasfella created this revision.Mon, Oct 7, 1:40 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptMon, Oct 7, 1:40 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
nicolasfella requested review of this revision.Mon, Oct 7, 1:40 PM
ngraham added a subscriber: ngraham.Mon, Oct 7, 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)Mon, Oct 7, 1:44 PM
  • Rename property
mart accepted this revision.Tue, Oct 8, 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.Tue, Oct 8, 1:28 PM
mart requested changes to this revision.Tue, Oct 8, 1:28 PM
This revision now requires changes to proceed.Tue, Oct 8, 1:28 PM
mart added inline comments.Tue, Oct 8, 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.Wed, Oct 9, 12:54 PM
  • Remove unused import
mart accepted this revision.Wed, Oct 9, 1:22 PM
This revision is now accepted and ready to land.Wed, Oct 9, 1:22 PM
This revision was automatically updated to reflect the committed changes.