1
0
Эх сурвалжийг харах

Larger default size of Synchronization checklist window on larger screens

Source commit: bbcafa5c84132024632d38d8b1cb123a447686b9
Martin Prikryl 7 жил өмнө
parent
commit
76e9c4e6ba

+ 2 - 2
source/forms/SynchronizeChecklist.cpp

@@ -95,7 +95,7 @@ void __fastcall TSynchronizeChecklistDialog::Execute(TSynchronizeChecklist * Che
     UnicodeString WindowParams = FormConfiguration.WindowParams;
     // if there is no main window, keep previous "custom pos" indication,
     bool CustomPos = (StrToIntDef(CutToChar(WindowParams, L';', true), 0) != 0);
-    if (Application->MainForm != NULL)
+    if (!IsMainFormLike(this))
     {
       CustomPos = (Application->MainForm->BoundsRect != BoundsRect);
     }
@@ -158,7 +158,7 @@ bool __fastcall TSynchronizeChecklistDialog::GetWindowParams(UnicodeString & Win
 {
   WindowParams = CustomWinConfiguration->SynchronizeChecklist.WindowParams;
   bool CustomPos = (StrToIntDef(CutToChar(WindowParams, L';', true), 0) != 0);
-  return CustomPos || (Application->MainForm == NULL);
+  return CustomPos || IsMainFormLike(this);
 }
 //---------------------------------------------------------------------------
 void __fastcall TSynchronizeChecklistDialog::CreateParams(TCreateParams & Params)

+ 7 - 1
source/windows/CustomWinConfiguration.cpp

@@ -10,6 +10,7 @@
 #include "CustomWinConfiguration.h"
 #include <Exceptions.h>
 #include <PasTools.hpp>
+#include <Math.hpp>
 //---------------------------------------------------------------------------
 #pragma package(smart_init)
 //---------------------------------------------------------------------------
@@ -103,8 +104,13 @@ void __fastcall TCustomWinConfiguration::Default()
   TGUIConfiguration::Default();
 
   FInterface = FDefaultInterface;
+  int WorkAreaWidthScaled = DimensionToDefaultPixelsPerInch(Screen->WorkAreaWidth);
+  int WorkAreaHeightScaled = DimensionToDefaultPixelsPerInch(Screen->WorkAreaHeight);
+  // Same as commander interface (really used only with /synchronize)
+  int ChecklistWidth = Min(WorkAreaWidthScaled - 40, 1090);
+  int ChecklistHeight = Min(WorkAreaHeightScaled - 30, 700);
   // 0 means no "custom-pos"
-  FSynchronizeChecklist.WindowParams = L"0;" + FormatDefaultWindowParams(600, 450);
+  FSynchronizeChecklist.WindowParams = L"0;" + FormatDefaultWindowParams(ChecklistWidth, ChecklistHeight);
   FSynchronizeChecklist.ListParams = L"1;1|150,1;100,1;80,1;130,1;25,1;100,1;80,1;130,1;@" + SaveDefaultPixelsPerInch() + L"|0;1;2;3;4;5;6;7";
   FFindFile.WindowParams = FormatDefaultWindowSize(646, 481);
   FFindFile.ListParams = L"3;1|125,1;181,1;80,1;122,1;@" + SaveDefaultPixelsPerInch() + L"|0;1;2;3";

+ 4 - 1
source/windows/Tools.cpp

@@ -255,7 +255,10 @@ void __fastcall RestoreForm(UnicodeString Data, TForm * Form, bool PositionOnly)
               Monitor->Top + ((Monitor->Height - Bounds.Height()) / 2),
               Bounds.Width(), Bounds.Height());
           }
-          Form->Position = poDesigned;
+          if (!Form->HandleAllocated())
+          {
+            Form->Position = poDesigned;
+          }
         }
       }
       else