mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:39:44 +02:00
lcl: treeview: fix tooltip hiding
git-svn-id: trunk@52362 -
This commit is contained in:
parent
4c522305c1
commit
f68cca0ca9
@ -3298,6 +3298,7 @@ type
|
||||
function GetShowSeparators: boolean;
|
||||
function GetToolTips: boolean;
|
||||
function GetTopItem: TTreeNode;
|
||||
procedure HintMouseLeave(Sender: TObject);
|
||||
procedure ImageListChange(Sender: TObject);
|
||||
procedure OnChangeTimer(Sender: TObject);
|
||||
procedure SetAutoExpand(Value: Boolean);
|
||||
|
@ -4128,6 +4128,12 @@ begin
|
||||
Result := FTopItem;
|
||||
end;
|
||||
|
||||
procedure TCustomTreeView.HintMouseLeave(Sender: TObject);
|
||||
begin
|
||||
if FindLCLControl(Mouse.CursorPos)<>Self then
|
||||
FHintWnd.Hide;
|
||||
end;
|
||||
|
||||
procedure TCustomTreeView.SetTopItem(Value: TTreeNode);
|
||||
begin
|
||||
if HandleAllocated and (Value <> nil) then
|
||||
@ -4235,7 +4241,10 @@ var
|
||||
MaxHintWidth: Integer;
|
||||
begin
|
||||
if FHintWnd=nil then
|
||||
begin
|
||||
FHintWnd:=THintWindow.Create(Self);
|
||||
FHintWnd.OnMouseLeave:=@HintMouseLeave;
|
||||
end;
|
||||
|
||||
Node:=GetNodeAt(X, Y);
|
||||
if Node=nil then
|
||||
@ -5528,7 +5537,8 @@ procedure TCustomTreeView.MouseLeave;
|
||||
begin
|
||||
FStates:=FStates-[tvsDblClicked,tvsTripleClicked,tvsQuadClicked,
|
||||
tvsEditOnMouseUp,tvsSingleSelectOnMouseUp];
|
||||
if Assigned(FHintWnd) then
|
||||
if Assigned(FHintWnd) and FHintWnd.Visible
|
||||
and not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos)) then
|
||||
FHintWnd.Hide;
|
||||
inherited MouseLeave;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user