mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 17:39:40 +02:00
IDEIntf: object inspector: fix hint position
git-svn-id: trunk@53369 -
This commit is contained in:
parent
e57fbc2eb3
commit
870a757670
@ -2358,18 +2358,20 @@ end;
|
|||||||
procedure TOICustomPropertyGrid.MouseMove(Shift:TShiftState; X,Y:integer);
|
procedure TOICustomPropertyGrid.MouseMove(Shift:TShiftState; X,Y:integer);
|
||||||
var
|
var
|
||||||
TheHint: String;
|
TheHint: String;
|
||||||
|
fPropRow: TOIPropertyGridRow;
|
||||||
|
|
||||||
procedure DoShow(pt: TPoint); inline;
|
procedure DoShow(pt: TPoint); inline;
|
||||||
begin
|
begin
|
||||||
FHintManager.ShowHint(ClientToScreen(pt), TheHint);
|
if WidgetSet.GetLCLCapability(lcTransparentWindow)=LCL_CAPABILITY_NO then
|
||||||
|
Inc(pt.Y, fPropRow.Height);
|
||||||
|
FHintManager.ShowHint(ClientToScreen(pt), TheHint, False);
|
||||||
if FHintManager.CurHintWindow<>nil then
|
if FHintManager.CurHintWindow<>nil then
|
||||||
FHintManager.CurHintWindow.OnMouseLeave := @HintMouseLeave;
|
FHintManager.CurHintWindow.OnMouseLeave := @HintMouseLeave;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
SplitDistance:integer;
|
SplitDistance:integer;
|
||||||
Index, Brd: Integer;
|
Index, TextLeft: Integer;
|
||||||
fPropRow: TOIPropertyGridRow;
|
|
||||||
HintType: TPropEditHint;
|
HintType: TPropEditHint;
|
||||||
begin
|
begin
|
||||||
inherited MouseMove(Shift,X,Y);
|
inherited MouseMove(Shift,X,Y);
|
||||||
@ -2414,9 +2416,9 @@ begin
|
|||||||
begin
|
begin
|
||||||
// Mouse is over property name...
|
// Mouse is over property name...
|
||||||
TheHint := fPropRow.Name;
|
TheHint := fPropRow.Name;
|
||||||
Brd := BorderWidth + GetTreeIconX(Index) + Indent;
|
TextLeft := BorderWidth + GetTreeIconX(Index) + Indent + 5;
|
||||||
if (Canvas.TextWidth(TheHint) + Brd) >= SplitterX then
|
if (Canvas.TextWidth(TheHint) + TextLeft) >= SplitterX-2 then
|
||||||
DoShow(Point(Brd, fPropRow.Top-TopY-1));
|
DoShow(Point(TextLeft - 3, fPropRow.Top-TopY-1));
|
||||||
end else
|
end else
|
||||||
if HintType in [pehValue,pehEditButton] then
|
if HintType in [pehValue,pehEditButton] then
|
||||||
begin
|
begin
|
||||||
@ -2424,8 +2426,9 @@ begin
|
|||||||
TheHint := fPropRow.LastPaintedValue;
|
TheHint := fPropRow.LastPaintedValue;
|
||||||
if length(TheHint) > 100 then
|
if length(TheHint) > 100 then
|
||||||
TheHint := copy(TheHint, 1, 100) + '...';
|
TheHint := copy(TheHint, 1, 100) + '...';
|
||||||
if Canvas.TextWidth(TheHint) > (ClientWidth - BorderWidth - SplitterX) then
|
TextLeft := SplitterX+2;
|
||||||
DoShow(Point(SplitterX, fPropRow.Top-TopY-1));
|
if Canvas.TextWidth(TheHint) > (ClientWidth - BorderWidth - TextLeft) then
|
||||||
|
DoShow(Point(TextLeft - 3, fPropRow.Top-TopY-1));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3493,7 +3496,7 @@ end;
|
|||||||
|
|
||||||
procedure TOICustomPropertyGrid.ResetLongHintTimer;
|
procedure TOICustomPropertyGrid.ResetLongHintTimer;
|
||||||
begin
|
begin
|
||||||
if FLongHintTimer = Nil then Exit;
|
if (FLongHintTimer = Nil) or FShowingLongHint then Exit;
|
||||||
FLongHintTimer.Enabled := False;
|
FLongHintTimer.Enabled := False;
|
||||||
if RowCount > 0 then
|
if RowCount > 0 then
|
||||||
FLongHintTimer.Enabled := not FDragging;
|
FLongHintTimer.Enabled := not FDragging;
|
||||||
|
Loading…
Reference in New Issue
Block a user