ActionToolBar: Automatically change to icon-only for actions marked KeepVisible
ClosedPublic

Authored by ahiemstra on Nov 6 2019, 6:41 PM.

Details

Summary

This changes the layouting code in ActionToolBar to support reducing
actions to IconOnly before hiding them for actions that have a
displayHint set to KeepVisible. This mimics behaviour that is currently
implemented in ToolBarHeader, where the main, left and right actions
will be reduced to an icon-only version when the page gets below a
certain width. The main difference in behaviour is that instead of
switching all three actions at the same time, the actions will be
switched one by one, which I feel makes more sense when using
ActionToolBar standalone.

Depends on D25176

Test Plan

With Kirigami Gallery, on the misc widgets page, behaviour of the second toolbar
is still the same.

Diff Detail

Repository
R169 Kirigami
Branch
actiontoolbar_icononly
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18618
Build 18636: arc lint + arc unit
ahiemstra created this revision.Nov 6 2019, 6:41 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptNov 6 2019, 6:41 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Nov 6 2019, 6:41 PM
broulik added inline comments.
src/controls/ActionToolBar.qml
111

Shouldn't this be

modelData.visible === undefined || modelData.visible

i.e. have the action show if visible is not defined

ahiemstra updated this revision to Diff 69463.Nov 8 2019, 4:20 PM
  • Fix showing actions with visible property undefined
ahiemstra marked an inline comment as done.Nov 8 2019, 4:21 PM
ahiemstra added inline comments.
src/controls/ActionToolBar.qml
111

You are right, fixed.

mart added a subscriber: mart.Nov 11 2019, 11:56 AM
mart added inline comments.
src/controls/private/ActionToolBarLayoutDetails.qml
1

please add this file to kirigami.qrc and kirigami.qrc.in

ahiemstra updated this revision to Diff 69580.Nov 11 2019, 12:17 PM
ahiemstra marked an inline comment as done.
  • Add ActionToolBarLayoutDetails.qml to qrc file
mart accepted this revision.Nov 11 2019, 1:38 PM
mart added inline comments.
kirigami.qrc
34 ↗(On Diff #69580)

also in kirigami.qrc.in then is good to go

This revision is now accepted and ready to land.Nov 11 2019, 1:38 PM
ahiemstra updated this revision to Diff 69588.Nov 11 2019, 3:50 PM
  • Also add to kirigami.qrc.in
This revision was automatically updated to reflect the committed changes.