Explorar o código

Bug 1382: Failure when displaying hint on color menu

https://winscp.net/tracker/1382

Source commit: 0ce85bd944c0687bd78393ef9513f74b095ce0de
Martin Prikryl %!s(int64=9) %!d(string=hai) anos
pai
achega
26a4f79b51
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      source/windows/TerminalManager.cpp

+ 5 - 2
source/windows/TerminalManager.cpp

@@ -780,10 +780,13 @@ void __fastcall TTerminalManager::ApplicationShowHint(UnicodeString & HintStr,
   {
     int HintMaxWidth = 300;
 
-    if (DebugAlwaysTrue(HintInfo.HintControl != NULL))
+    TControl * ScaleControl = HintInfo.HintControl;
+    if (DebugAlwaysFalse(HintInfo.HintControl == NULL) ||
+        (GetParentForm(HintInfo.HintControl) == NULL))
     {
-      HintMaxWidth = ScaleByTextHeight(HintInfo.HintControl, HintMaxWidth);
+      ScaleControl = ScpExplorer;
     }
+    HintMaxWidth = ScaleByTextHeight(ScaleControl, HintMaxWidth);
 
     HintInfo.HintMaxWidth = HintMaxWidth;
   }