Properly check enabled state of Action for ActionToolBar buttons

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



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

R169 Kirigami
No Linters Available
No Unit Test Coverage
Build Status
Buildable 17444
Build 17462: arc lint + arc unit
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


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.

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.