Add a mode to center actions and omit the title when using a ToolBar style
ClosedPublic

Authored by ngraham on Sep 10 2019, 7:09 PM.

Details

Summary

This patch implements an optional and off-by-default feature to center the actions and
omit the title when displaying the ToolBar style. This is useful for simple desktop apps
that don't need to display a title in the toolbar, where centered toolbuttons look
better than right-aligned toolbuttons.

FEATURE: 404203
CCBUG: 402948
FIXED-IN: 5.63

Test Plan

Apply this patch to Kirigami then run Kamoso after applying D23847.

Before:

After:

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.
ngraham created this revision.Sep 10 2019, 7:09 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptSep 10 2019, 7:09 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Sep 10 2019, 7:09 PM
ndavis accepted this revision.Sep 10 2019, 7:22 PM
This revision is now accepted and ready to land.Sep 10 2019, 7:22 PM
ngraham edited the test plan for this revision. (Show Details)Sep 10 2019, 7:24 PM
mart added a comment.Sep 11 2019, 3:49 PM

Like the concept, API may need a bit of improvement

src/controls/PageRow.qml
146

This name for property is a bit... Meh
I would export a qt.alignment property *and* the icon position enum

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

Perhaps a state machine with AnchorChange may make it a bit better and reliable

ngraham updated this revision to Diff 65864.Sep 11 2019, 5:25 PM
ngraham marked 2 inline comments as done.

Make it better

Thanks, hopefully this is better. Now there's a Qt.Alignment property. Not sure what you mean about the icon position enum though. Would appreciate clarification.

ngraham updated this revision to Diff 65866.Sep 11 2019, 5:27 PM

Fix typo

mart accepted this revision.Sep 16 2019, 10:43 AM
mart accepted this revision.

One thing i forgot: how does this look when a title is present?

ngraham added a comment.EditedSep 16 2019, 1:46 PM
In D23845#532373, @mart wrote:

One thing i forgot: how does this look when a title is present?

It doesn't; titleLoader doesn't load the title when the actions are using left or centered alignment (because then there's no room for the title)

This revision was automatically updated to reflect the committed changes.