Browse Source

Merge pull request #1669 from AvaloniaUI/feature/tooltips-obey-screen-edges

ensure tooltips fit inside screen edges.
pull/1671/head
danwalmsley 8 years ago
committed by GitHub
parent
commit
6c8dd737b0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/Avalonia.Controls/ToolTip.cs

3
src/Avalonia.Controls/ToolTip.cs

@ -234,11 +234,12 @@ namespace Avalonia.Controls
{ {
Close(); Close();
_popup = new PopupRoot { Content = this }; _popup = new PopupRoot { Content = this, };
((ISetLogicalParent)_popup).SetParent(control); ((ISetLogicalParent)_popup).SetParent(control);
_popup.Position = Popup.GetPosition(control, GetPlacement(control), _popup, _popup.Position = Popup.GetPosition(control, GetPlacement(control), _popup,
GetHorizontalOffset(control), GetVerticalOffset(control)); GetHorizontalOffset(control), GetVerticalOffset(control));
_popup.Show(); _popup.Show();
_popup.SnapInsideScreenEdges();
} }
private void Close() private void Close()

Loading…
Cancel
Save