mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 10:39:30 +02:00
IdeIntf: hint manager: shrink height of fixed hints. (Fix for r55095 #9b548421fa.)
git-svn-id: trunk@55142 -
This commit is contained in:
parent
cd76f09f06
commit
a33e8c7b11
@ -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,
|
See the file COPYING.modifiedLGPL.txt, included in this distribution,
|
||||||
@ -362,9 +363,6 @@ end;
|
|||||||
|
|
||||||
function THintWindowManager.ShowHint(ScreenPos: TPoint; TheHint: string;
|
function THintWindowManager.ShowHint(ScreenPos: TPoint; TheHint: string;
|
||||||
const MouseOffset: Boolean; HintFont: TFont): boolean;
|
const MouseOffset: Boolean; HintFont: TFont): boolean;
|
||||||
var
|
|
||||||
ms: TMemoryStream;
|
|
||||||
NewWidth, NewHeight: integer;
|
|
||||||
|
|
||||||
procedure DoText;
|
procedure DoText;
|
||||||
var
|
var
|
||||||
@ -377,14 +375,14 @@ var
|
|||||||
if MouseOffset then
|
if MouseOffset then
|
||||||
HintTextWindow.OffsetHintRect(ScreenPos)
|
HintTextWindow.OffsetHintRect(ScreenPos)
|
||||||
else
|
else
|
||||||
HintTextWindow.OffsetHintRect(ScreenPos, 0);
|
HintTextWindow.OffsetHintRect(ScreenPos, 0, True, False); // shrink height only for fixed (no MouseOffset) hints
|
||||||
HintTextWindow.ActivateHint(TheHint);
|
HintTextWindow.ActivateHint(TheHint);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DoHtml;
|
procedure DoHtml;
|
||||||
var
|
var
|
||||||
ActFrm: TForm;
|
ms: TMemoryStream;
|
||||||
MaxWidth, MaxHeight: Integer;
|
NewWidth, NewHeight: integer;
|
||||||
begin
|
begin
|
||||||
if HintFont<>nil then
|
if HintFont<>nil then
|
||||||
HintRenderWindow.Font := HintFont;
|
HintRenderWindow.Font := HintFont;
|
||||||
@ -399,31 +397,17 @@ var
|
|||||||
ms.Free;
|
ms.Free;
|
||||||
end;
|
end;
|
||||||
HtmlHelpProvider.ControlIntf.GetPreferredControlSize(NewWidth,NewHeight);
|
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
|
if NewWidth <= 0 then
|
||||||
NewWidth := 500
|
NewWidth := 500;
|
||||||
else if NewWidth > MaxWidth then
|
|
||||||
NewWidth := MaxWidth;
|
|
||||||
if NewHeight <= 0 then
|
if NewHeight <= 0 then
|
||||||
NewHeight := 200
|
NewHeight := 200;
|
||||||
else if NewHeight > MaxHeight then
|
|
||||||
NewHeight := MaxHeight;
|
|
||||||
HintRenderWindow.HintRectAdjust := Rect(0, 0, NewWidth, NewHeight);
|
HintRenderWindow.HintRectAdjust := Rect(0, 0, NewWidth, NewHeight);
|
||||||
if MouseOffset then
|
if MouseOffset then
|
||||||
HintRenderWindow.OffsetHintRect(ScreenPos)
|
HintRenderWindow.OffsetHintRect(ScreenPos)
|
||||||
else
|
else
|
||||||
HintRenderWindow.OffsetHintRect(ScreenPos, 0);
|
HintRenderWindow.OffsetHintRect(ScreenPos, 0, True, False); // shrink height only for fixed (no MouseOffset) hints
|
||||||
HintRenderWindow.ActivateRendered;
|
HintRenderWindow.ActivateRendered;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user