Skip to content

Commit

Permalink
reduce LongHoverTime to 250ms for #1386; much less waiting and better…
Browse files Browse the repository at this point in the history
… discoverability, while still not annoying and in the way
  • Loading branch information
kkoreilly committed Dec 21, 2024
1 parent 148a9bc commit ea4ce72
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ type DeviceSettingsData struct { //types:add
DragStartDistance int `default:"4" min:"0" max:"100" step:"1"`

// The amount of time to wait before initiating a long hover event (e.g., for opening a tooltip)
LongHoverTime time.Duration `default:"500ms" min:"10ms" max:"10s" step:"10ms"`
LongHoverTime time.Duration `default:"250ms" min:"10ms" max:"10s" step:"10ms"`

// The maximum number of pixels that mouse can move and still register a long hover event
LongHoverStopDistance int `default:"5" min:"0" max:"1000" step:"1"`
Expand Down
2 changes: 1 addition & 1 deletion docs/content/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sr.On(events.MouseLeave, func(e events.Event) {

### Long hover

A long hover start event is triggered when a user leaves their mouse over a [[abilities#long hoverable]] widget for 500 milliseconds (that duration can be customized in the [[settings]]). That event results in any specified [[tooltip]] being shown. A long hover end event is sent whenever a user moves their mouse a certain distance, moves it off of a widget, or presses it down. That event causes any visible tooltip to disappear.
A long hover start event is triggered when a user leaves their mouse over a [[abilities#long hoverable]] widget for 250 milliseconds (that duration can be customized in the [[settings]]). That event results in any specified [[tooltip]] being shown. A long hover end event is sent whenever a user moves their mouse a certain distance, moves it off of a widget, or presses it down. That event causes any visible tooltip to disappear.

```Go
bt := core.NewButton(b).SetText("Hello")
Expand Down
2 changes: 1 addition & 1 deletion docs/content/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Categories = ["Widgets"]
+++

**Tooltips** give the user additional information about a [[widget]]. Users can view tooltips by [[events#long hover]]ing over a widget for 500 milliseconds or [[events#long press]]ing down on a widget for 500 milliseconds, so tooltips work on all platforms.
**Tooltips** give the user additional information about a [[widget]]. Users can view tooltips by [[events#long hover]]ing over a widget for 250 milliseconds or [[events#long press]]ing down on a widget for 500 milliseconds, so tooltips work on all platforms.

You can set the tooltip of any widget:

Expand Down

0 comments on commit ea4ce72

Please sign in to comment.