Properly check enabled state of Action for ActionToolBar buttons
ClosedPublic

Authored by ahiemstra on Tue, Oct 8, 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.Tue, Oct 8, 1:46 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptTue, Oct 8, 1:46 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Tue, Oct 8, 1:46 PM
ngraham accepted this revision.Tue, Oct 8, 1:54 PM
This revision is now accepted and ready to land.Tue, Oct 8, 1:54 PM
apol added a subscriber: apol.Tue, Oct 8, 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.Wed, Oct 9, 11:39 AM
  • Do not implicitly convert float to bool
ahiemstra marked an inline comment as done.Wed, Oct 9, 11:40 AM
ahiemstra added inline comments.
src/controls/ActionToolBar.qml
126

Agreed. I made the opacity check more explicit.

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