favorites: add add/remove icons

git-svn-id: trunk@50812 -
This commit is contained in:
ondrej 2015-12-15 08:04:49 +00:00
parent 873b3e4baa
commit 173aff6805

View File

@ -145,6 +145,8 @@ begin
if Assigned(FOrigOnPopup) then if Assigned(FOrigOnPopup) then
FOrigOnPopup(Sender); FOrigOnPopup(Sender);
if DropdownMenu.Images=nil then
DropdownMenu.Images := IDEImages.Images_16;
xM := DropdownMenu.Items; xM := DropdownMenu.Items;
xMIndex := 0; xMIndex := 0;
@ -164,9 +166,14 @@ begin
xAddToFav := TFileNameMenuItem.Create(Self); xAddToFav := TFileNameMenuItem.Create(Self);
xAddToFav.FileName := xProj.ProjectInfoFile; xAddToFav.FileName := xProj.ProjectInfoFile;
if not FavHandler.IsInFavoriteProjects(xProj.ProjectInfoFile) then if not FavHandler.IsInFavoriteProjects(xProj.ProjectInfoFile) then
xAddToFav.Caption := Format(sAddToFavoritesS, [xProj.ProjectInfoFile]) begin
else xAddToFav.Caption := Format(sAddToFavoritesS, [xProj.ProjectInfoFile]);
xAddToFav.ImageIndex := IDEImages.LoadImage(16, 'laz_add');
end else
begin
xAddToFav.Caption := Format(sRemoveFromFavoritesS, [xProj.ProjectInfoFile]); xAddToFav.Caption := Format(sRemoveFromFavoritesS, [xProj.ProjectInfoFile]);
xAddToFav.ImageIndex := IDEImages.LoadImage(16, 'laz_delete');
end;
xAddToFav.OnClick := @mnuAddRemoveActiveProject; xAddToFav.OnClick := @mnuAddRemoveActiveProject;
xM.Insert(xMIndex, xAddToFav); xM.Insert(xMIndex, xAddToFav);
Inc(xMIndex); Inc(xMIndex);