File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1053,7 +1053,13 @@ procedure TUIRibbon.ImageListChange(Sender: TObject);
10531053 begin
10541054 // Check if this command has an action. If yes, use the action's image index.
10551055 if Assigned(lCommand.ActionLink) and Assigned(lCommand.ActionLink.Action) then
1056- lImageIndex := TCustomAction(lCommand.ActionLink.Action).ImageIndex
1056+ begin
1057+ // Check if this commands action manager is the one we registered for changes. Skip otherwise.
1058+ if (lCommand.ActionLink.Action is TContainedAction) and (TContainedAction(lCommand.ActionLink.Action).ActionList <> Self.ActionManager) then
1059+ continue;
1060+
1061+ lImageIndex := TCustomAction(lCommand.ActionLink.Action).ImageIndex;
1062+ end
10571063 else
10581064 continue;
10591065
@@ -1217,14 +1223,14 @@ procedure TUIRibbon.RegisterForImageChanges;
12171223 // Create and register our TChangeLink object, so that we can react to updated images of the action manger.
12181224 if Assigned(fActionManager) then
12191225 begin
1220- if Assigned(fActionManager.Images) then
1226+ if not Assigned(fImageChangeLink) and Assigned(fActionManager.Images) then
12211227 begin
12221228 fImageChangeLink := TChangeLink.Create;
12231229 fImageChangeLink.OnChange := ImagelistChange;
12241230 fActionManager.Images.RegisterChanges(fImageChangeLink);
12251231 end ;
12261232
1227- if (fActionManager is TActionManager) and Assigned((fActionManager as TActionManager).LargeImages) then
1233+ if not Assigned(fLargeImageChangeLink) and (fActionManager is TActionManager) and Assigned((fActionManager as TActionManager).LargeImages) then
12281234 begin
12291235 fLargeImageChangeLink := TChangeLink.Create;
12301236 fLargeImageChangeLink.OnChange := ImagelistChange;
You can’t perform that action at this time.
0 commit comments