fix(ui): DPI-масштабирование SettingsForm/DeviceForm + общий DpiScale

Вся раскладка окон, построенных кодом (SettingsForm, DeviceForm), была
захардкожена в пикселях под неявные 96 DPI — на Windows 125-200% или
HiDPI-десктопах контролы физически не росли вместе с укрупнившимся
шрифтом. Добавлено масштабирование SetBounds через MulDiv(V,
Screen.PixelsPerInch, 96) на каждой листовой точке потребления
(const-блоки раскладки не трогались).

Общий DpiScale вынесен в новый юнит DpiUtils.pas — убрана дублированная
копия одноимённого приватного метода в 9 классах (FlatCheckBox,
FlatComboBox, FlatListBox, FlatSpinEdit, FlatFloatSpinEdit, FlatEdit,
FlatRadioButton, FlatPopupMenu, SettingsForm, DeviceForm) и инлайн-MulDiv
без обёртки в MainForm.pas/PanafallPanel.pas.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-29 16:05:39 +03:00
co-authored by Claude Sonnet 5
parent 041bc6ba7a
commit c95620fb23
14 changed files with 222 additions and 237 deletions
+1 -9
View File
@@ -9,7 +9,7 @@ interface
uses
Classes, SysUtils, Controls, Graphics, Forms, LCLType, LMessages, Types, Math,
AppTheme;
AppTheme, DpiUtils;
type
TFlatRadioButton = class(TCustomControl)
@@ -27,7 +27,6 @@ type
FClrDot: TColor;
FClrText: TColor;
FClrTextDisabled: TColor;
function DpiScale(V: Integer): Integer;
procedure SetCheckedSilently(V: Boolean);
procedure SetChecked(V: Boolean);
procedure DoChange;
@@ -93,13 +92,6 @@ begin
FClrTextDisabled := TColor($00666666);
end;
function TFlatRadioButton.DpiScale(V: Integer): Integer;
begin
Result := MulDiv(V, Screen.PixelsPerInch, 96);
if (V > 0) and (Result < 1) then
Result := 1;
end;
procedure TFlatRadioButton.SetAppTheme(const T: TAppTheme);
begin
FClrBG := T.Panel;