mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 23:40:26 +02:00
IDE: projectinspector: load project icon from LazProject and not from file
git-svn-id: trunk@51352 -
This commit is contained in:
parent
05a7bbab34
commit
7c9c153453
@ -1356,14 +1356,15 @@ end;
|
||||
|
||||
procedure TProjectInspectorForm.UpdateTitle;
|
||||
var
|
||||
NewCaption, IconFile: String;
|
||||
NewCaption: String;
|
||||
IconStream: TStream;
|
||||
begin
|
||||
if not CanUpdate(pifNeedUpdateTitle) then exit;
|
||||
|
||||
Icon.Clear;
|
||||
if LazProject=nil then
|
||||
begin
|
||||
Caption:=lisMenuProjectInspector;
|
||||
Icon.Clear;
|
||||
end else
|
||||
begin
|
||||
NewCaption:=LazProject.GetTitle;
|
||||
@ -1371,11 +1372,16 @@ begin
|
||||
NewCaption:=ExtractFilenameOnly(LazProject.ProjectInfoFile);
|
||||
Caption:=Format(lisProjInspProjectInspector, [NewCaption]);
|
||||
|
||||
IconFile := ChangeFileExt(LazProject.MainFilename, '.ico');
|
||||
if FileExists(IconFile) then
|
||||
Icon.LoadFromFile(IconFile)
|
||||
else
|
||||
Icon.Clear;
|
||||
if not LazProject.ProjResources.ProjectIcon.IsEmpty then
|
||||
begin
|
||||
IconStream := LazProject.ProjResources.ProjectIcon.GetStream;
|
||||
if IconStream<>nil then
|
||||
try
|
||||
Icon.LoadFromStream(IconStream);
|
||||
finally
|
||||
IconStream.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user