Improve hover behavior when not enough space

This changes the hover's position fallback logic from:

If not enough room on right
  Position left
If not enough room on left
  Position right

To:

If not enough room on right
  If enough room on left
    Position left
  Else
    Position below
If not enough room on left
   If enough room on right
     Position right
   Else
     Position below

A new option showHoverHint is also added as part of this which will show a hint
to the user to hold alt/option in order to mouse over the hover (only when the
evaluated hover is true). This is an explicit setting such that it doesn't show
up on hovers such as the activity bar which looks awkward.

Fixes #176704
This commit is contained in:
Daniel Imms
2023-03-28 15:04:27 -07:00
parent 4a1e2a4a6f
commit 4dfdf2adf0
4 changed files with 56 additions and 7 deletions

View File

@@ -114,6 +114,11 @@
line-height: 22px;
}
.monaco-hover .hover-row.status-bar .info {
font-style: italic;
padding: 0px 8px;
}
.monaco-hover .hover-row.status-bar .actions {
display: flex;
padding: 0px 8px;