Browse Source

Issue 2288 – Tree indentation does not scale correctly

https://winscp.net/tracker/2288

Source commit: 043b0ba3da5deb0eeafb5e2f082680459142f338
Martin Prikryl 1 year ago
parent
commit
363f3e3446
1 changed files with 12 additions and 0 deletions
  1. 12 0
      source/windows/VCLCommon.cpp

+ 12 - 0
source/windows/VCLCommon.cpp

@@ -496,6 +496,11 @@ friend void __fastcall ShowAsModal(TForm * Form, void *& Storage, bool BringToFr
 friend void __fastcall HideAsModal(TForm * Form, void *& Storage);
 friend void __fastcall ShowFormNoActivate(TForm * Form);
 };
+//---------------------------------------------------------------------
+class TPublicTreeView : public TCustomTreeView
+{
+friend void __fastcall ChangeControlScale(TControl * Control, int M, int D);
+};
 //---------------------------------------------------------------------------
 void __fastcall RealignControl(TControl * Control)
 {
@@ -568,6 +573,13 @@ static void __fastcall ChangeControlScale(TControl * Control, int M, int D)
     }
   }
 
+  TCustomTreeView * CustomTreeView = dynamic_cast<TCustomTreeView *>(Control);
+  if (CustomTreeView != NULL)
+  {
+    TPublicTreeView * PublicTreeView = static_cast<TPublicTreeView *>(CustomTreeView);
+    PublicTreeView->Indent = MulDiv(PublicTreeView->Indent, M, D);
+  }
+
   TCustomCombo * CustomCombo = dynamic_cast<TCustomCombo *>(Control);
   if (CustomCombo != NULL)
   {