IDE: Show icons in the tree of key mapping options. Issue #35923. Patch from FTurtle.

git-svn-id: trunk@61855 -
This commit is contained in:
juha 2019-09-10 21:51:55 +00:00
parent 83e546aa9f
commit b6ea318732

View File

@ -432,6 +432,18 @@ begin
Result := TEditorOptions;
end;
function GetIDECommandImageIndex(AKeyRelation: TKeyCommandRelation): Integer;
var
IDECommand: TIDECommand;
begin
IDECommand:=IDECommandList.FindIDECommand(AKeyRelation.Command);
if IDECommand.UserCount=0 then
Exit(imgKeyItem);
Result:=IDECommand.Users[0].ImageIndex;
if Result=-1 then
Result:=imgKeyItem;
end;
procedure TEditorKeymappingOptionsFrame.FillKeyMappingTreeView;
var
i, j: Integer;
@ -472,7 +484,7 @@ begin
end
else
NewKeyNode := Items.AddChildObject(NewCategoryNode,ItemCaption, CurKeyRelation);
NewKeyNode.ImageIndex := imgKeyItem;
NewKeyNode.ImageIndex := GetIDECommandImageIndex(CurKeyRelation);
NewKeyNode.SelectedIndex := NewKeyNode.ImageIndex;
inc(ChildNodeIndex);
end;