From a33e8c7b11fdf9905db7974ec2d44456a7c3efbd Mon Sep 17 00:00:00 2001 From: ondrej Date: Thu, 1 Jun 2017 11:42:37 +0000 Subject: [PATCH] IdeIntf: hint manager: shrink height of fixed hints. (Fix for r55095 #9b548421fa.) git-svn-id: trunk@55142 - --- components/ideintf/idehelpintf.pas | 32 ++++++++---------------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/components/ideintf/idehelpintf.pas b/components/ideintf/idehelpintf.pas index 89e36cc678..d4fb9dca07 100644 --- a/components/ideintf/idehelpintf.pas +++ b/components/ideintf/idehelpintf.pas @@ -1,3 +1,4 @@ +{ $Id: helpintf.pas 9271 2006-05-13 12:00:43Z mattias $ } { ***************************************************************************** See the file COPYING.modifiedLGPL.txt, included in this distribution, @@ -362,9 +363,6 @@ end; function THintWindowManager.ShowHint(ScreenPos: TPoint; TheHint: string; const MouseOffset: Boolean; HintFont: TFont): boolean; -var - ms: TMemoryStream; - NewWidth, NewHeight: integer; procedure DoText; var @@ -377,14 +375,14 @@ var if MouseOffset then HintTextWindow.OffsetHintRect(ScreenPos) else - HintTextWindow.OffsetHintRect(ScreenPos, 0); + HintTextWindow.OffsetHintRect(ScreenPos, 0, True, False); // shrink height only for fixed (no MouseOffset) hints HintTextWindow.ActivateHint(TheHint); end; procedure DoHtml; var - ActFrm: TForm; - MaxWidth, MaxHeight: Integer; + ms: TMemoryStream; + NewWidth, NewHeight: integer; begin if HintFont<>nil then HintRenderWindow.Font := HintFont; @@ -399,31 +397,17 @@ var ms.Free; end; HtmlHelpProvider.ControlIntf.GetPreferredControlSize(NewWidth,NewHeight); - ActFrm:=Screen.ActiveForm; - if Assigned(ActFrm) then - begin - MaxWidth := ActFrm.Left + ActFrm.Width - ScreenPos.x; - MaxHeight := ActFrm.Top + ActFrm.Height - ScreenPos.y; - end - else - begin - MaxWidth := Screen.Width; - MaxHeight := Screen.Height; - end; if NewWidth <= 0 then - NewWidth := 500 - else if NewWidth > MaxWidth then - NewWidth := MaxWidth; + NewWidth := 500; if NewHeight <= 0 then - NewHeight := 200 - else if NewHeight > MaxHeight then - NewHeight := MaxHeight; + NewHeight := 200; + HintRenderWindow.HintRectAdjust := Rect(0, 0, NewWidth, NewHeight); if MouseOffset then HintRenderWindow.OffsetHintRect(ScreenPos) else - HintRenderWindow.OffsetHintRect(ScreenPos, 0); + HintRenderWindow.OffsetHintRect(ScreenPos, 0, True, False); // shrink height only for fixed (no MouseOffset) hints HintRenderWindow.ActivateRendered; end;