Changeset 38 for trunk/Components/Common/UScaleDPI.pas
- Timestamp:
- Apr 18, 2019, 3:34:38 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Components/Common/UScaleDPI.pas
r34 r38 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); … … 248 249 Temp[i].Free; 249 250 end; 251 ImgList.EndUpdate; 250 252 end; 251 253 … … 284 286 WinControl: TWinControl; 285 287 ToolBarControl: TToolBar; 286 OldAnchors: TAnchors; 287 OldAutoSize: Boolean; 288 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 289 304 //if Control is TMemo then Exit; 290 305 //if Control is TForm then … … 316 331 MinWidth := ScaleX(MinWidth, FromDPI.X); 317 332 MinHeight := ScaleY(MinHeight, FromDPI.Y); 318 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); 319 336 //Control.Invalidate; 320 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; 321 344 EndUpdate; 322 345 end; … … 330 353 end; 331 354 332 //if not (Control is TCustomPage) then333 if Control is TWinControl then begin334 WinControl := TWinControl(Control);335 if WinControl.ControlCount > 0 then begin336 for I := 0 to WinControl.ControlCount - 1 do begin337 if WinControl.Controls[I] is TControl then begin338 ScaleControl(WinControl.Controls[I], FromDPI);339 end;340 end;341 end;342 end;343 355 //if Control is TForm then 344 356 // Control.EnableAutoSizing;
Note:
See TracChangeset
for help on using the changeset viewer.