Explorar o código

Scaling Up/Down buttons width on numerical inputs

Source commit: 7eeea681a6203f82f4bcaf4f6c47d798fa54a805
Martin Prikryl %!s(int64=10) %!d(string=hai) anos
pai
achega
0060c8a043
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      source/packages/my/UpDownEdit.pas

+ 2 - 3
source/packages/my/UpDownEdit.pas

@@ -147,7 +147,7 @@ procedure Register;
 implementation
 
 uses
-  CommCtrl;
+  CommCtrl, PasTools, Math;
 
 procedure Register;
 begin
@@ -156,8 +156,7 @@ end;
 
 function DefBtnWidth: Integer;
 begin
-  Result := GetSystemMetrics(SM_CXVSCROLL);
-  if Result > 15 then Result := 15;
+  Result := Min(GetSystemMetrics(SM_CXVSCROLL), ScaleByPixelsPerInch(15));
 end;
 
 type