Add a displayHint property to Action
ClosedPublic

Authored by ahiemstra on Wed, Nov 6, 6:40 PM.

Details

Summary

This property can be used to indicate preferences on how to display the
action to implementations using Action. It mimics some of the behaviour
of QAction's priority property, but is more explicit and allows some
behaviour the priority property would not.

Additionally, this changes PrivateActionToolButton to make use of the
displayHint property for its showText and showMenuArrow properties.

Test Plan

Tool buttons created through actions in Kirigami gallery still show
their text and menu arrows.

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:40 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptWed, Nov 6, 6:40 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Wed, Nov 6, 6:40 PM
leinir added a subscriber: leinir.Thu, Nov 7, 9:40 AM
leinir added inline comments.
src/controls/Action.qml
128

Might be nice to have a DisplayHint.NoHint value, to make it more explicit what that 0 means

broulik added inline comments.
src/controls/Action.qml
128

Isn't it more like a "no preference" value?
Also, please document the default value

leinir added inline comments.Thu, Nov 7, 11:00 AM
src/controls/Action.qml
128

You're right, NoPreference would probably be more linguistically correct... i was more thinking along the lines of, if the default means there is no preferred hint, then NoHint would be it... either would be fine for me, though :)

ahiemstra updated this revision to Diff 69462.Fri, Nov 8, 4:02 PM
  • Add and use DisplayHint.NoPreference value for displayHint default
ahiemstra marked 3 inline comments as done.Fri, Nov 8, 4:04 PM
ahiemstra added inline comments.
src/controls/Action.qml
128

I have added a NoPreference value which is now the default and documented as such. I went with the NoPreference suggestion since that makes it more clear when overriding displayHint in other places.

mart accepted this revision.Mon, Nov 11, 11:43 AM
This revision is now accepted and ready to land.Mon, Nov 11, 11:43 AM
This revision was automatically updated to reflect the committed changes.
ahiemstra marked an inline comment as done.