Changeset 48 for trunk/Forms
- Timestamp:
- Dec 3, 2021, 2:07:27 PM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r47 r48 137 137 Top = 16 138 138 Width = 207 139 Center = True 139 140 PopupMenu = PopupMenuPhoto 140 141 Proportional = True -
trunk/Forms/UFormContact.pas
r47 r48 147 147 FOnPrevious: TNotifyEvent; 148 148 FormProperties: TFormProperties; 149 ProfilePhotoActive: Boolean; 150 procedure DefaultPhoto; 149 151 procedure SetContact(AValue: TContact); 150 152 procedure ReloadAllPropertiesTab; … … 210 212 211 213 // Photo 212 if (ImagePhoto.Picture.Bitmap.Width <> 0) and (ImagePhoto.Picture.Bitmap.Height <> 0)then begin214 if ProfilePhotoActive then begin 213 215 PhotoProperty := Contact.GetProperty(cfPhoto); 214 216 if not Assigned(PhotoProperty) then begin … … 292 294 ImagePhoto.Picture.Bitmap.SetSize(JpegImage.Width, JpegImage.Height); 293 295 ImagePhoto.Picture.Bitmap.Canvas.Draw(0, 0, JpegImage); 296 ProfilePhotoActive := True; 294 297 except 298 DefaultPhoto; 295 299 end; 296 300 finally … … 300 304 try 301 305 ImagePhoto.Picture.LoadFromStream(Stream); 306 ProfilePhotoActive := True; 302 307 except 308 DefaultPhoto; 303 309 end; 304 310 end; … … 306 312 Stream.Free; 307 313 end; 308 end ;309 end ;314 end else DefaultPhoto; 315 end else DefaultPhoto; 310 316 end; 311 317 … … 400 406 end; 401 407 408 procedure TFormContact.DefaultPhoto; 409 begin 410 ProfilePhotoActive := False; 411 ImagePhoto.Picture.Assign(Core.GetProfileImage.Picture); 412 end; 413 402 414 procedure TFormContact.SetContact(AValue: TContact); 403 415 begin … … 458 470 procedure TFormContact.UpdateInterface; 459 471 begin 460 APhotoSave.Enabled := (ImagePhoto.Picture.Bitmap.Width <> 0) and 461 (ImagePhoto.Picture.Bitmap.Height <> 0); 472 APhotoSave.Enabled := ProfilePhotoActive; 462 473 end; 463 474
Note:
See TracChangeset
for help on using the changeset viewer.