mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 20:39:23 +02:00
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:
parent
83e546aa9f
commit
b6ea318732
@ -432,6 +432,18 @@ begin
|
|||||||
Result := TEditorOptions;
|
Result := TEditorOptions;
|
||||||
end;
|
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;
|
procedure TEditorKeymappingOptionsFrame.FillKeyMappingTreeView;
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
@ -472,7 +484,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
NewKeyNode := Items.AddChildObject(NewCategoryNode,ItemCaption, CurKeyRelation);
|
NewKeyNode := Items.AddChildObject(NewCategoryNode,ItemCaption, CurKeyRelation);
|
||||||
NewKeyNode.ImageIndex := imgKeyItem;
|
NewKeyNode.ImageIndex := GetIDECommandImageIndex(CurKeyRelation);
|
||||||
NewKeyNode.SelectedIndex := NewKeyNode.ImageIndex;
|
NewKeyNode.SelectedIndex := NewKeyNode.ImageIndex;
|
||||||
inc(ChildNodeIndex);
|
inc(ChildNodeIndex);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user