Changeset 48 for trunk/UCore.pas
- Timestamp:
- Dec 3, 2021, 2:07:27 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r43 r48 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, Controls, ActnList, Forms, Dialogs, 8 Classes, SysUtils, FileUtil, Controls, ActnList, Forms, Dialogs, ExtCtrls, 9 9 ULastOpenedList, UApplicationInfo, UPersistentForm, UScaleDPI, UCommon, 10 10 UTranslator, UDataFile, Menus, URegistry, UTheme, UAboutDialog, Registry; … … 69 69 InitializeFinished: Boolean; 70 70 LoadErrors: string; 71 ProfileImage: TImage; 71 72 procedure FileModified(Sender: TObject); 72 73 function FindFirstNonOption: string; … … 81 82 ReopenLastFileOnStart: Boolean; 82 83 ToolbarVisible: Boolean; 84 function GetProfileImage: TImage; 83 85 procedure FileNew; 84 86 procedure FileOpen(FileName: string); … … 294 296 FileClose; 295 297 SaveConfig; 298 if Assigned(ProfileImage) then 299 FreeAndNil(ProfileImage); 296 300 end; 297 301 … … 454 458 end; 455 459 460 function TCore.GetProfileImage: TImage; 461 const 462 ProfilePhotoFileName = 'Images/Profile.png'; 463 begin 464 if not Assigned(ProfileImage) then begin 465 ProfileImage := TImage.Create(nil); 466 ProfileImage.Picture.LoadFromFile(ProfilePhotoFileName); 467 if FileExists(ProfilePhotoFileName) then 468 ProfileImage.Picture.LoadFromFile(ProfilePhotoFileName); 469 end; 470 Result := ProfileImage; 471 end; 472 456 473 procedure TCore.UpdateInterface; 457 474 begin
Note:
See TracChangeset
for help on using the changeset viewer.