Skip to content

feat: Ribbon is a PopoverOwner and an Animator - #500

Merged
tannevaled merged 1 commit into
mainfrom
ribbon-popover-owner
Oct 22, 2026
Merged

tannevaled merged 1 commit into
mainfrom
ribbon-popover-owner

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Found while reading how the go-slides playground hosts widgets: its root is a PopoverHost, which draws PopoverOwners after the tree and offers them clicks first. The Ribbon of #499 drew its menus from a DrawPopup the host had to call and could not receive clicks below its bounds, so it did not work under a PopoverHost.

  • Ribbon implements PopoverOwner (PopoverOpen, PopoverBounds, DrawPopover - the former DrawPopup, PopoverClick). Test: a ribbon in a VBox under a PopoverHost - the menu hangs over the content, the host draws it, a click on a row below the ribbon runs it, a click elsewhere closes it and passes through, a collapsed ribbon's body is clickable, keytips end on a click away.
  • Ribbon implements Animator: Tick(dt seconds) and Animating(), so TickTree drives the tooltip delay. (Tick took milliseconds and returned a bool in feat: Ribbon, an Office-style command ribbon #499, released minutes ago as v0.334.0; this is a breaking change below 1.0.0, so MINOR.)
  • 100% per function, gofmt/vet clean.

🤖 Generated with Claude Code

Under a PopoverHost (the root of an application) the ribbon's menus, drop-down
lists, folded groups, a collapsed ribbon's peeking body, tooltips and keytips
are now drawn after the tree and receive the clicks that land on them, with
no host code: PopoverOpen, PopoverBounds, DrawPopover (renamed from DrawPopup)
and PopoverClick. A click elsewhere closes what is open and goes on.

Tick is now the toolkit's Animator contract, Tick(dt seconds) plus
Animating(), so TickTree drives the tooltip delay and a host that repaints
only while something animates keeps painting until the tooltip shows. (Tick
used to take milliseconds and return a bool; v0.334.0 shipped minutes ago.)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit d1a74b4 into main Oct 22, 2026
1 check passed
@tannevaled
tannevaled deleted the ribbon-popover-owner branch October 22, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant