mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 18:40:29 +02:00
IDE: new designer option: Force DPI scaling in design-time
git-svn-id: trunk@56975 -
This commit is contained in:
parent
3da6552057
commit
09de874143
@ -501,6 +501,7 @@ type
|
|||||||
FRubberbandSelectsGrandChilds: boolean;
|
FRubberbandSelectsGrandChilds: boolean;
|
||||||
FCheckPackagesOnFormCreate: boolean;
|
FCheckPackagesOnFormCreate: boolean;
|
||||||
FFormTitleBarChangesObjectInspector: boolean;
|
FFormTitleBarChangesObjectInspector: boolean;
|
||||||
|
FForceDPIScalingInDesignTime: boolean;
|
||||||
|
|
||||||
// object inspector
|
// object inspector
|
||||||
FObjectInspectorOptions: TOIOptions;
|
FObjectInspectorOptions: TOIOptions;
|
||||||
@ -755,6 +756,8 @@ type
|
|||||||
write FSwitchToFavoritesOITab;
|
write FSwitchToFavoritesOITab;
|
||||||
property FormTitleBarChangesObjectInspector: boolean read FFormTitleBarChangesObjectInspector
|
property FormTitleBarChangesObjectInspector: boolean read FFormTitleBarChangesObjectInspector
|
||||||
write FFormTitleBarChangesObjectInspector;
|
write FFormTitleBarChangesObjectInspector;
|
||||||
|
property ForceDPIScalingInDesignTime: boolean read FForceDPIScalingInDesignTime
|
||||||
|
write FForceDPIScalingInDesignTime;
|
||||||
|
|
||||||
// object inspector
|
// object inspector
|
||||||
property ObjectInspectorOptions: TOIOptions read FObjectInspectorOptions;
|
property ObjectInspectorOptions: TOIOptions read FObjectInspectorOptions;
|
||||||
@ -1629,6 +1632,7 @@ begin
|
|||||||
FCreateComponentFocusNameProperty:=false;
|
FCreateComponentFocusNameProperty:=false;
|
||||||
FSwitchToFavoritesOITab:=false;
|
FSwitchToFavoritesOITab:=false;
|
||||||
FFormTitleBarChangesObjectInspector:=false;
|
FFormTitleBarChangesObjectInspector:=false;
|
||||||
|
FForceDPIScalingInDesignTime:=true;
|
||||||
|
|
||||||
// object inspector
|
// object inspector
|
||||||
FObjectInspectorOptions:=TOIOptions.Create;
|
FObjectInspectorOptions:=TOIOptions.Create;
|
||||||
@ -2071,6 +2075,7 @@ begin
|
|||||||
Path+'FormEditor/CreateComponentFocusNameProperty/Value',false);
|
Path+'FormEditor/CreateComponentFocusNameProperty/Value',false);
|
||||||
FSwitchToFavoritesOITab:=FXMLCfg.GetValue(Path+'FormEditor/SwitchToFavoritesOITab/Value',false);
|
FSwitchToFavoritesOITab:=FXMLCfg.GetValue(Path+'FormEditor/SwitchToFavoritesOITab/Value',false);
|
||||||
FFormTitleBarChangesObjectInspector:=FXMLCfg.GetValue(Path+'FormEditor/FormTitleBarChangesObjectInspector/Value',false);
|
FFormTitleBarChangesObjectInspector:=FXMLCfg.GetValue(Path+'FormEditor/FormTitleBarChangesObjectInspector/Value',false);
|
||||||
|
FForceDPIScalingInDesignTime:=FXMLCfg.GetValue(Path+'FormEditor/ForceDPIScalingInDesignTime/Value',true);
|
||||||
|
|
||||||
if not OnlyDesktop then
|
if not OnlyDesktop then
|
||||||
LoadNonDesktop(Path);
|
LoadNonDesktop(Path);
|
||||||
@ -2418,6 +2423,7 @@ begin
|
|||||||
FCreateComponentFocusNameProperty,false);
|
FCreateComponentFocusNameProperty,false);
|
||||||
FXMLCfg.SetDeleteValue(Path+'FormEditor/SwitchToFavoritesOITab/Value',FSwitchToFavoritesOITab,false);
|
FXMLCfg.SetDeleteValue(Path+'FormEditor/SwitchToFavoritesOITab/Value',FSwitchToFavoritesOITab,false);
|
||||||
FXMLCfg.SetDeleteValue(Path+'FormEditor/FormTitleBarChangesObjectInspector/Value',FFormTitleBarChangesObjectInspector,false);
|
FXMLCfg.SetDeleteValue(Path+'FormEditor/FormTitleBarChangesObjectInspector/Value',FFormTitleBarChangesObjectInspector,false);
|
||||||
|
FXMLCfg.SetDeleteValue(Path+'FormEditor/ForceDPIScalingInDesignTime/Value',FForceDPIScalingInDesignTime,true);
|
||||||
|
|
||||||
FXMLCfg.SetDeleteValue(Path+'ShowCompileDialog/Value',FShowCompileDialog,False);
|
FXMLCfg.SetDeleteValue(Path+'ShowCompileDialog/Value',FShowCompileDialog,False);
|
||||||
FXMLCfg.SetDeleteValue(Path+'AutoCloseCompileDialog/Value',FAutoCloseCompileDialog,False);
|
FXMLCfg.SetDeleteValue(Path+'AutoCloseCompileDialog/Value',FAutoCloseCompileDialog,False);
|
||||||
|
@ -142,14 +142,14 @@ object FormEditorOptionsFrame: TFormEditorOptionsFrame
|
|||||||
AnchorSideBottom.Control = Owner
|
AnchorSideBottom.Control = Owner
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 205
|
Height = 250
|
||||||
Top = 238
|
Top = 238
|
||||||
Width = 769
|
Width = 769
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
Caption = 'FormEditMiscGroupBox'
|
Caption = 'FormEditMiscGroupBox'
|
||||||
ClientHeight = 185
|
ClientHeight = 230
|
||||||
ClientWidth = 765
|
ClientWidth = 765
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
object ShowComponentCaptionsCheckBox: TCheckBox
|
object ShowComponentCaptionsCheckBox: TCheckBox
|
||||||
@ -312,18 +312,34 @@ object FormEditorOptionsFrame: TFormEditorOptionsFrame
|
|||||||
AnchorSideBottom.Control = FormEditMiscGroupBox
|
AnchorSideBottom.Control = FormEditMiscGroupBox
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 17
|
Height = 19
|
||||||
Top = 166
|
Top = 182
|
||||||
Width = 247
|
Width = 270
|
||||||
Anchors = [akTop, akLeft, akBottom]
|
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 3
|
BorderSpacing.Top = 3
|
||||||
BorderSpacing.Bottom = 6
|
BorderSpacing.Bottom = 3
|
||||||
Caption = 'FormTitleBarChangesObjectInspectorCheckBox'
|
Caption = 'FormTitleBarChangesObjectInspectorCheckBox'
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
end
|
end
|
||||||
|
object ForceDPIScalingInDesignTimeCheckBox: TCheckBox
|
||||||
|
AnchorSideLeft.Control = FormEditMiscGroupBox
|
||||||
|
AnchorSideTop.Control = FormTitleBarChangesObjectInspectorCheckBox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideBottom.Side = asrBottom
|
||||||
|
Left = 6
|
||||||
|
Height = 19
|
||||||
|
Top = 204
|
||||||
|
Width = 230
|
||||||
|
BorderSpacing.Left = 6
|
||||||
|
BorderSpacing.Top = 3
|
||||||
|
BorderSpacing.Bottom = 6
|
||||||
|
Caption = 'ForceDPIScalingInDesignTimeCheckBox'
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
TabOrder = 10
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object GuideLinesGroupBox: TGroupBox
|
object GuideLinesGroupBox: TGroupBox
|
||||||
AnchorSideLeft.Control = DesignerColorsGroupBox
|
AnchorSideLeft.Control = DesignerColorsGroupBox
|
||||||
|
@ -43,6 +43,7 @@ type
|
|||||||
|
|
||||||
TFormEditorOptionsFrame = class(TAbstractIDEOptionsEditor)
|
TFormEditorOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||||
FormTitleBarChangesObjectInspectorCheckBox: TCheckBox;
|
FormTitleBarChangesObjectInspectorCheckBox: TCheckBox;
|
||||||
|
ForceDPIScalingInDesignTimeCheckBox: TCheckBox;
|
||||||
SwitchToFavoritesOITabCheckBox:TCheckBox;
|
SwitchToFavoritesOITabCheckBox:TCheckBox;
|
||||||
CheckPackagesOnFormCreateCheckBox: TCheckBox;
|
CheckPackagesOnFormCreateCheckBox: TCheckBox;
|
||||||
OpenDesignerOnOpenUnitCheckBox: TCheckBox;
|
OpenDesignerOnOpenUnitCheckBox: TCheckBox;
|
||||||
@ -139,6 +140,8 @@ procedure TFormEditorOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
|||||||
CheckPackagesOnFormCreateCheckBox.Hint:=dlgCheckPackagesOnFormCreateHint;
|
CheckPackagesOnFormCreateCheckBox.Hint:=dlgCheckPackagesOnFormCreateHint;
|
||||||
FormTitleBarChangesObjectInspectorCheckBox.Caption:=dlgFormTitleBarChangesObjectInspector;
|
FormTitleBarChangesObjectInspectorCheckBox.Caption:=dlgFormTitleBarChangesObjectInspector;
|
||||||
FormTitleBarChangesObjectInspectorCheckBox.Hint:=dlgFormTitleBarChangesObjectInspectorHint;
|
FormTitleBarChangesObjectInspectorCheckBox.Hint:=dlgFormTitleBarChangesObjectInspectorHint;
|
||||||
|
ForceDPIScalingInDesignTimeCheckBox.Caption:=dlgForceDPIScalingInDesignTime;
|
||||||
|
ForceDPIScalingInDesignTimeCheckBox.Hint:=dlgForceDPIScalingInDesignTimeHint;
|
||||||
end;
|
end;
|
||||||
begin
|
begin
|
||||||
GridGroupBox.Caption := dlgEnvGrid;
|
GridGroupBox.Caption := dlgEnvGrid;
|
||||||
@ -182,6 +185,7 @@ begin
|
|||||||
SwitchToFavoritesOITabCheckBox.Checked := SwitchToFavoritesOITab;
|
SwitchToFavoritesOITabCheckBox.Checked := SwitchToFavoritesOITab;
|
||||||
SwitchToFavoritesOITabCheckBox.Enabled := CreateCompFocusNameCheckBox.Checked;
|
SwitchToFavoritesOITabCheckBox.Enabled := CreateCompFocusNameCheckBox.Checked;
|
||||||
FormTitleBarChangesObjectInspectorCheckBox.Checked := FormTitleBarChangesObjectInspector;
|
FormTitleBarChangesObjectInspectorCheckBox.Checked := FormTitleBarChangesObjectInspector;
|
||||||
|
ForceDPIScalingInDesignTimeCheckBox.Checked := ForceDPIScalingInDesignTime;
|
||||||
end;
|
end;
|
||||||
FLoaded := True;
|
FLoaded := True;
|
||||||
end;
|
end;
|
||||||
@ -216,6 +220,7 @@ begin
|
|||||||
CreateComponentFocusNameProperty := CreateCompFocusNameCheckBox.Checked;
|
CreateComponentFocusNameProperty := CreateCompFocusNameCheckBox.Checked;
|
||||||
SwitchToFavoritesOITab := SwitchToFavoritesOITabCheckBox.Checked;
|
SwitchToFavoritesOITab := SwitchToFavoritesOITabCheckBox.Checked;
|
||||||
FormTitleBarChangesObjectInspector := FormTitleBarChangesObjectInspectorCheckBox.Checked;
|
FormTitleBarChangesObjectInspector := FormTitleBarChangesObjectInspectorCheckBox.Checked;
|
||||||
|
ForceDPIScalingInDesignTime := ForceDPIScalingInDesignTimeCheckBox.Checked;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1482,6 +1482,8 @@ resourcestring
|
|||||||
dlgFormTitleBarChangesObjectInspector = 'Change Object Inspector contents on clicking form title bar';
|
dlgFormTitleBarChangesObjectInspector = 'Change Object Inspector contents on clicking form title bar';
|
||||||
dlgFormTitleBarChangesObjectInspectorHint = 'Show a form''s properties in Object Inspector '
|
dlgFormTitleBarChangesObjectInspectorHint = 'Show a form''s properties in Object Inspector '
|
||||||
+'by clicking on its title bar.';
|
+'by clicking on its title bar.';
|
||||||
|
dlgForceDPIScalingInDesignTime = 'Force DPI scaling in design-time';
|
||||||
|
dlgForceDPIScalingInDesignTimeHint = 'When checked the project scaling settings will be ignored - only the form/frame/datamodule Scaled property will be taken into account.';
|
||||||
|
|
||||||
dlgEnvGrid = 'Grid';
|
dlgEnvGrid = 'Grid';
|
||||||
dlgEnvLGuideLines = 'Guide lines';
|
dlgEnvLGuideLines = 'Guide lines';
|
||||||
|
@ -6508,7 +6508,8 @@ begin
|
|||||||
if NewComponent is TCustomDesignControl then
|
if NewComponent is TCustomDesignControl then
|
||||||
begin
|
begin
|
||||||
DsgControl := TCustomDesignControl(NewComponent);
|
DsgControl := TCustomDesignControl(NewComponent);
|
||||||
if Project1.Scaled and DsgControl.Scaled and (DsgControl.DesignTimePPI<>Screen.PixelsPerInch) then
|
if (Project1.Scaled or EnvironmentOptions.ForceDPIScalingInDesignTime)
|
||||||
|
and DsgControl.Scaled and (DsgControl.DesignTimePPI<>Screen.PixelsPerInch) then
|
||||||
begin
|
begin
|
||||||
DsgControl.AutoAdjustLayout(lapAutoAdjustForDPI, DsgControl.DesignTimePPI, Screen.PixelsPerInch, 0, 0);
|
DsgControl.AutoAdjustLayout(lapAutoAdjustForDPI, DsgControl.DesignTimePPI, Screen.PixelsPerInch, 0, 0);
|
||||||
DesignerProcs.ScaleNonVisual(DsgControl, DsgControl.DesignTimePPI, Screen.PixelsPerInch);
|
DesignerProcs.ScaleNonVisual(DsgControl, DsgControl.DesignTimePPI, Screen.PixelsPerInch);
|
||||||
|
Loading…
Reference in New Issue
Block a user