Properly check enabled state of Action for ActionToolBar buttons
ClosedPublic

Authored by ahiemstra on Oct 8 2019, 1:46 PM.

Details

Summary

The opacity binding overrides PrivateActionToolButton's enabled binding,
which means an Action's enabled property does not get checked for
ActionToolBar buttons.

Test Plan

With kirigami2gallery, on the Misc Widgets page, change the enabled property
of one of the actions in the toolbar. Observe that the tool button now gets
disabled correctly.

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.Oct 8 2019, 1:46 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptOct 8 2019, 1:46 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Oct 8 2019, 1:46 PM
ngraham accepted this revision.Oct 8 2019, 1:54 PM
This revision is now accepted and ready to land.Oct 8 2019, 1:54 PM
apol added a subscriber: apol.Oct 8 2019, 1:54 PM

+1 otherwise

src/controls/ActionToolBar.qml
126

I'd do the enabled && opacity, it feels very wrong using a real number as a boolean >.<.

ahiemstra updated this revision to Diff 67543.Oct 9 2019, 11:39 AM
  • Do not implicitly convert float to bool
ahiemstra marked an inline comment as done.Oct 9 2019, 11:40 AM
ahiemstra added inline comments.
src/controls/ActionToolBar.qml
126

Agreed. I made the opacity check more explicit.

mart accepted this revision.Oct 9 2019, 1:20 PM
This revision was automatically updated to reflect the committed changes.
ahiemstra marked an inline comment as done.