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

Authored by ahiemstra on Wed, Nov 6, 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahiemstra created this revision.Wed, Nov 6, 6:41 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptWed, Nov 6, 6:41 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Wed, Nov 6, 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.Fri, Nov 8, 4:20 PM
  • Fix showing actions with visible property undefined
ahiemstra marked an inline comment as done.Fri, Nov 8, 4:21 PM
ahiemstra added inline comments.
src/controls/ActionToolBar.qml
111

You are right, fixed.

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

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

ahiemstra updated this revision to Diff 69580.Mon, Nov 11, 12:17 PM
ahiemstra marked an inline comment as done.
  • Add ActionToolBarLayoutDetails.qml to qrc file
mart accepted this revision.Mon, Nov 11, 1:38 PM
mart added inline comments.
kirigami.qrc
35

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

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