lcl: spin edit: scale UpDown with height

This commit is contained in:
Ondrej Pokorny 2022-09-29 04:12:51 +02:00
parent 30789b5c94
commit 4aa7b5b350

View File

@ -322,7 +322,6 @@ begin
WinHandle := AWinControl.Handle;
UpDown := GetWin32WindowInfo(WinHandle)^.UpDown;
UpDownWidth := GetUpDownWidth(AWinControl);
if (AWinControl as TCustomFloatSpinEdit).BorderStyle = bsNone then
BorderWidth := 0
else if (WindowsVersion >= wvXP) and ThemeServices.ThemesEnabled then
@ -330,6 +329,8 @@ begin
else
BorderWidth := GetSystemMetrics(SM_CXEDGE);
UpDownWidth := (Height - BorderWidth * 2) div 5 * 4 +1 {to get odd number}; // calculate from height to scale it
DWP := BeginDeferWindowPos(2);
DeferWindowPos(DWP, UpDown, WinHandle, Left + Width - UpDownWidth - BorderWidth,
Top+BorderWidth, UpDownWidth, Height - BorderWidth * 2, SWP_NOACTIVATE);