Browse Source

Bug 1990: Broken layout of Properties dialog when opening on a secondary display with high DPI primary display

https://winscp.net/tracker/1990

Source commit: b165a566e112ea3d8329d1b99ecd05d06f69bb6d
Martin Prikryl 4 years ago
parent
commit
c62602c715
1 changed files with 8 additions and 0 deletions
  1. 8 0
      source/forms/Properties.cpp

+ 8 - 0
source/forms/Properties.cpp

@@ -775,6 +775,14 @@ void __fastcall TPropertiesDialog::CMDpiChanged(TMessage & Message)
   {
   {
     UpdateFileImage();
     UpdateFileImage();
   }
   }
+
+  // WORKAROUND: Mere presence of the RightsFrame breaks automatic layout on DPI change in some situation, fixing it manually.
+  // (opening on a secondary display with 100%, while primary display has 150%)
+  SizeLabel->Width = CalculateSizeButton->Left - ScaleByTextHeight(this, 8) - SizeLabel->Left;
+  Bevel1->Width = CommonSheet->ClientWidth - (Bevel1->Left * 2);
+  Bevel2->Width = Bevel1->Width;
+  Bevel3->Width = Bevel1->Width;
+  RecursiveBevel->Width = Bevel1->Width;
 }
 }
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 void __fastcall TPropertiesDialog::Dispatch(void * Message)
 void __fastcall TPropertiesDialog::Dispatch(void * Message)