View Issue Details

IDProjectCategoryView StatusLast Update
0035601PatchesLCLpublic2019-05-22 16:43
ReporterAlexey Tor.Assigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0035601: Support high-dpi for InputBox
Descriptionthis adds scaling of form width + borderSpacings. tested on Win10 with scale=150%.
TagsNo tags attached.
Fixed in Revisionr61272
LazTarget-
Widgetset
Attached Files
  • in.diff (1,584 bytes)
    Index: lcl/include/inputdialog.inc
    ===================================================================
    --- lcl/include/inputdialog.inc	(revision 61242)
    +++ lcl/include/inputdialog.inc	(working copy)
    @@ -25,7 +25,7 @@
       Form: TForm;
       Prompt: TLabel;
       Edit: TEdit;
    -  MinEditWidth: integer;
    +  MinEditWidth, NSpacing: integer;
       AMonitor: TMonitor;
     begin
       Result := False;
    @@ -38,6 +38,7 @@
         BorderStyle := bsDialog;
         Caption := InputCaption;
         Position := poScreenCenter;
    +    NSpacing := Scale96ToScreen(6);
         Prompt := TLabel.Create(Form);
         with Prompt do
         begin
    @@ -52,12 +53,12 @@
           Parent := Form;
           Top := Prompt.Height;
           Align := alTop;
    -      BorderSpacing.Top := 3;
    +      BorderSpacing.Top := NSpacing div 2;
           AMonitor := _InputQueryActiveMonitor;
           // check that edit is smaller than our monitor, it must be smaller at least
           // by 6 * 2 pixels (spacing from window borders) + window border
           MinEditWidth := Min(AMonitor.Width - 20,
    -        Max(cInputQueryEditSizePixels,
    +        Max(Scale96ToScreen(cInputQueryEditSizePixels),
                 AMonitor.Width * cInputQueryEditSizePercents div 100));
           Constraints.MinWidth := MinEditWidth;
           Text := Value;
    @@ -83,8 +84,8 @@
           Align := alTop;
         end;
     
    -    ChildSizing.TopBottomSpacing := 6;
    -    ChildSizing.LeftRightSpacing := 6;
    +    ChildSizing.TopBottomSpacing := NSpacing;
    +    ChildSizing.LeftRightSpacing := NSpacing;
         AutoSize := True;
     
         // upon show, the edit control will be focused for editing, because it's
    
    in.diff (1,584 bytes)

Activities

Alexey Tor.

2019-05-19 01:01

reporter  

in.diff (1,584 bytes)
Index: lcl/include/inputdialog.inc
===================================================================
--- lcl/include/inputdialog.inc	(revision 61242)
+++ lcl/include/inputdialog.inc	(working copy)
@@ -25,7 +25,7 @@
   Form: TForm;
   Prompt: TLabel;
   Edit: TEdit;
-  MinEditWidth: integer;
+  MinEditWidth, NSpacing: integer;
   AMonitor: TMonitor;
 begin
   Result := False;
@@ -38,6 +38,7 @@
     BorderStyle := bsDialog;
     Caption := InputCaption;
     Position := poScreenCenter;
+    NSpacing := Scale96ToScreen(6);
     Prompt := TLabel.Create(Form);
     with Prompt do
     begin
@@ -52,12 +53,12 @@
       Parent := Form;
       Top := Prompt.Height;
       Align := alTop;
-      BorderSpacing.Top := 3;
+      BorderSpacing.Top := NSpacing div 2;
       AMonitor := _InputQueryActiveMonitor;
       // check that edit is smaller than our monitor, it must be smaller at least
       // by 6 * 2 pixels (spacing from window borders) + window border
       MinEditWidth := Min(AMonitor.Width - 20,
-        Max(cInputQueryEditSizePixels,
+        Max(Scale96ToScreen(cInputQueryEditSizePixels),
             AMonitor.Width * cInputQueryEditSizePercents div 100));
       Constraints.MinWidth := MinEditWidth;
       Text := Value;
@@ -83,8 +84,8 @@
       Align := alTop;
     end;
 
-    ChildSizing.TopBottomSpacing := 6;
-    ChildSizing.LeftRightSpacing := 6;
+    ChildSizing.TopBottomSpacing := NSpacing;
+    ChildSizing.LeftRightSpacing := NSpacing;
     AutoSize := True;
 
     // upon show, the edit control will be focused for editing, because it's
in.diff (1,584 bytes)

Juha Manninen

2019-05-22 16:43

developer   ~0116338

Applied, thanks.

Issue History

Date Modified Username Field Change
2019-05-19 01:01 Alexey Tor. New Issue
2019-05-19 01:01 Alexey Tor. File Added: in.diff
2019-05-22 16:24 Juha Manninen Assigned To => Juha Manninen
2019-05-22 16:24 Juha Manninen Status new => assigned
2019-05-22 16:43 Juha Manninen Status assigned => resolved
2019-05-22 16:43 Juha Manninen Resolution open => fixed
2019-05-22 16:43 Juha Manninen Fixed in Revision => r61272
2019-05-22 16:43 Juha Manninen LazTarget => -
2019-05-22 16:43 Juha Manninen Note Added: 0116338