mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 15:19:29 +02:00
lcl: spin edit: scale UpDown with height
This commit is contained in:
parent
30789b5c94
commit
4aa7b5b350
@ -322,7 +322,6 @@ begin
|
|||||||
WinHandle := AWinControl.Handle;
|
WinHandle := AWinControl.Handle;
|
||||||
UpDown := GetWin32WindowInfo(WinHandle)^.UpDown;
|
UpDown := GetWin32WindowInfo(WinHandle)^.UpDown;
|
||||||
|
|
||||||
UpDownWidth := GetUpDownWidth(AWinControl);
|
|
||||||
if (AWinControl as TCustomFloatSpinEdit).BorderStyle = bsNone then
|
if (AWinControl as TCustomFloatSpinEdit).BorderStyle = bsNone then
|
||||||
BorderWidth := 0
|
BorderWidth := 0
|
||||||
else if (WindowsVersion >= wvXP) and ThemeServices.ThemesEnabled then
|
else if (WindowsVersion >= wvXP) and ThemeServices.ThemesEnabled then
|
||||||
@ -330,6 +329,8 @@ begin
|
|||||||
else
|
else
|
||||||
BorderWidth := GetSystemMetrics(SM_CXEDGE);
|
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);
|
DWP := BeginDeferWindowPos(2);
|
||||||
DeferWindowPos(DWP, UpDown, WinHandle, Left + Width - UpDownWidth - BorderWidth,
|
DeferWindowPos(DWP, UpDown, WinHandle, Left + Width - UpDownWidth - BorderWidth,
|
||||||
Top+BorderWidth, UpDownWidth, Height - BorderWidth * 2, SWP_NOACTIVATE);
|
Top+BorderWidth, UpDownWidth, Height - BorderWidth * 2, SWP_NOACTIVATE);
|
||||||
|
Loading…
Reference in New Issue
Block a user