Skip to content

feat: Ribbon.OnLeave and Ribbon.Measure - #501

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

tannevaled merged 1 commit into
mainfrom
ribbon-onleave

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Two seams found while wiring the ribbon into the go-slides playground.

  • Ribbon.OnLeave func(): called when the keyboard use of the ribbon is over (a command ran from the keyboard, Escape on the tabs with nothing open, keytips ended or toggled off), so the host hands the keyboard back to the editor. A click does not call it.
  • Ribbon.Measure(availW, availH): the ribbon is a natural size for VBox.AddNatural, and follows Collapsed() when the box is laid out again.

100% per function; gofmt/vet clean.

🤖 Generated with Claude Code

OnLeave tells the host the keyboard use of the ribbon is over - a command ran
from the keyboard, Escape on the tabs with nothing open, the keytips ended - so
it can give the keyboard back to the editor. Measure makes the ribbon a natural
size for VBox.AddNatural: the width offered, the height it needs now (which
shrinks when collapsed), with no host code to resize it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit d871803 into main Oct 22, 2026
1 check passed
@tannevaled
tannevaled deleted the ribbon-onleave branch October 22, 2026 17:09
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