LCL: Don't modify hint position when it is shown via calling HintWindow.ActivateWithBounds method (useful for SynEdit).

Also cleanup useless FActivating assignment (it is a simple field
without any side effects).
This commit is contained in:
Maxim Ganetsky 2024-11-14 02:47:41 +03:00
parent add8755ea8
commit 301fcda550

View File

@ -241,14 +241,9 @@ procedure THintWindow.ActivateHint(const AHint: String);
begin
if FActivating then exit;
AdjustBoundsForMonitor;
if Visible and (Caption=AHint)
and EqualRect(FHintRect, BoundsRect) then
begin
FActivating := FActivating;
Exit; // nothing changed, exit -> don't flicker
end;
FActivating := True;
try
@ -265,9 +260,12 @@ end;
procedure THintWindow.ActivateHint(ARect: TRect; const AHint: String);
begin
HintRect := ARect;
AdjustBoundsForMonitor;
ActivateHint(AHint);
end;
// The purpose of this method is to allow showing a hint without
// adjusting its position via AdjustBoundsForMonitor call.
procedure THintWindow.ActivateWithBounds(ARect: TRect; const AHint: String);
begin
HintRect := ARect;
@ -277,6 +275,7 @@ end;
procedure THintWindow.ActivateHintData(ARect: TRect; const AHint: String; AData: pointer);
begin
HintRect := ARect;
AdjustBoundsForMonitor;
ActivateHint(AHint); // AData is not used now.
end;