fix(tracker/gioui): make own TipArea ensuring tips don't stay around

Closes #141.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2025-06-23 18:02:05 +03:00
parent 31007515b5
commit 6f1db6b392
5 changed files with 156 additions and 12 deletions

View File

@ -17,7 +17,6 @@ import (
"gioui.org/text"
"gioui.org/unit"
"gioui.org/widget"
"gioui.org/x/component"
"github.com/vsariola/sointu/tracker"
)
@ -27,7 +26,7 @@ type (
history []widget.Press
requestClicks int
TipArea component.TipArea // since almost all buttons have tooltips, we include the state for a tooltip here for convenience
TipArea TipArea // since almost all buttons have tooltips, we include the state for a tooltip here for convenience
}
ButtonStyle struct {
@ -289,13 +288,6 @@ func (b *ToggleIconButton) Layout(gtx C) D {
return b.IconButton.Layout(gtx)
}
func Tooltip(th *Theme, tip string) component.Tooltip {
tooltip := component.PlatformTooltip(&th.Material, tip)
tooltip.Bg = th.Tooltip.Bg
tooltip.Text.Color = th.Tooltip.Color
return tooltip
}
// Click executes a simple programmatic click.
func (b *Clickable) Click() {
b.requestClicks++