Changeset 308 for trunk/Packages/Common/UScaleDPI.pas
- Timestamp:
- Aug 18, 2021, 11:50:13 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UScaleDPI.pas
r145 r308 215 215 I: Integer; 216 216 begin 217 ImgList.BeginUpdate; 217 218 NewWidth := ScaleX(ImgList.Width, FromDPI.X); 218 219 NewHeight := ScaleY(ImgList.Height, FromDPI.Y); … … 226 227 Temp[I] := TBitmap.Create; 227 228 Temp[I].SetSize(NewWidth, NewHeight); 228 {$ifdef linux}229 Temp[I].PixelFormat := pf24bit;230 {$else}231 229 Temp[I].PixelFormat := pf32bit; 232 {$endif}233 230 Temp[I].TransparentColor := TempBmp.TransparentColor; 234 231 //Temp[I].TransparentMode := TempBmp.TransparentMode; … … 252 249 Temp[i].Free; 253 250 end; 251 ImgList.EndUpdate; 254 252 end; 255 253 … … 288 286 WinControl: TWinControl; 289 287 ToolBarControl: TToolBar; 290 OldAnchors: TAnchors; 291 OldAutoSize: Boolean; 292 begin 288 //OldAnchors: TAnchors; 289 //OldAutoSize: Boolean; 290 begin 291 //if not (Control is TCustomPage) then 292 // Resize childs first 293 if Control is TWinControl then begin 294 WinControl := TWinControl(Control); 295 if WinControl.ControlCount > 0 then begin 296 for I := 0 to WinControl.ControlCount - 1 do begin 297 if WinControl.Controls[I] is TControl then begin 298 ScaleControl(WinControl.Controls[I], FromDPI); 299 end; 300 end; 301 end; 302 end; 303 293 304 //if Control is TMemo then Exit; 294 305 //if Control is TForm then … … 320 331 MinWidth := ScaleX(MinWidth, FromDPI.X); 321 332 MinHeight := ScaleY(MinHeight, FromDPI.Y); 322 Width := ScaleX(Width, FromDPI.X); 333 // Workaround to bad band width auto sizing 334 //Width := ScaleX(Width, FromDPI.X); 335 Width := ScaleX(Control.Width + 28, FromDPI.X); 323 336 //Control.Invalidate; 324 337 end; 338 // Workaround for bad autosizing of coolbar 339 if AutoSize then begin 340 AutoSize := False; 341 Height := ScaleY(Height, FromDPI.Y); 342 AutoSize := True; 343 end; 325 344 EndUpdate; 326 345 end; … … 334 353 end; 335 354 336 //if not (Control is TCustomPage) then337 if Control is TWinControl then begin338 WinControl := TWinControl(Control);339 if WinControl.ControlCount > 0 then begin340 for I := 0 to WinControl.ControlCount - 1 do begin341 if WinControl.Controls[I] is TControl then begin342 ScaleControl(WinControl.Controls[I], FromDPI);343 end;344 end;345 end;346 end;347 355 //if Control is TForm then 348 356 // Control.EnableAutoSizing;
Note:
See TracChangeset
for help on using the changeset viewer.