Repository navigation
feat(donut): the centre shows cancel while a file is over it (#1446) - #1977
Open
cre8ive-marketing wants to merge 3 commits into
Open
cre8ive-marketing wants to merge 3 commits into
cre8ive-marketing wants to merge 3 commits into
Conversation
While a dragged file is over the donut's centre, the centre now fades to a DangerBrush tint with a DangerBrush ring, a cross is drawn above its text and "Drop here to cancel" is bold. It snaps when animations are off. The cursor stays as before. Closes KnifeLemon#1446
KnifeLemon
reviewed
Dec 2, 2026
KnifeLemon
left a comment
Owner
There was a problem hiding this comment.
Thanks @cre8ive-marketing, this builds on the existing hot state as planned, and the headless pixel test is a good touch.
Small things:
FinishAnimations()(the stalled-loop fallback) snaps_hover,_centerPulseand_expand, but not the new_cancel. If frames stop mid-fade (say the window hides right after a drop on the centre), the red tint can stay partway and show on the next open. Could you add_cancel = new Spring { Value = _externalCenterHot ? 1 : 0 };there?- Contrast bar: the test uses 3:1 for "bold text". WCAG's bold large-text exception starts at 14 pt (about 18.7 px), and the subtitle is 11.5 px bold, so for the text the bar is 4.5:1. 3:1 is right for the ✕. Could you check the text at 4.5:1, or tell us which looks fall short?
- Minor: only the tint and the ring fade. The ✕, the bold red text and the 8 px shift of the title switch at once, so "It fades in and out" in the CHANGELOG is a bit generous.
We'll also look at it on the smallest donut with a long translation (German), to make sure the ✕ and a two-line bold subtitle stay inside the hole.
# Conflicts: # CHANGELOG.md
… when frames stop - Red bold text on the red tint missed 4.5:1 in the Soft looks (3.71 light, 4.46 dark) and MaterialYou light (3.71-4.41). The text now keeps the text colour (8.6:1 or more); the ✕, ring and tint stay red (✕ 3.71:1 or more). The contrast test checks the text at 4.5:1 and the ✕ at 3:1. - FinishAnimations snaps the cancel fade, so no tint is left partway for the next open. - CHANGELOG says what fades and what switches at once.
Collaborator
Author
|
Thanks, done in 68fef60:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1446
What changes
This strengthens the existing hot state in
DonutMenu.DrawCenterinstead of adding a second one. The ⊘ cursor stays._cancelspring goes to 1 while_externalCenterHotis set, and back to 0 after. It snaps whenMotion.Enabledis false, as the rest ofDonutMenudoes.DangerBrushat 22% (was 18%), with a 2 pxDangerBrushring, both faded by the spring.DangerBrushis drawn above the title, with the text. The layout makes room for it, andCenterPlanKeyhas a newCancelflag, so cached layouts with and without it stay apart.donut.cancel(the subtitle while hot) is drawn in the bold typeface.Tests
DonutHighlightTests.The_centre_fades_into_its_cancel_look_and_back:DonutHighlightTests.The_cancel_centre_is_drawn_in_the_danger_colour: a headless render. A pixel in the centre, below the text, is neutral before and red after.AccentContrastTests.The_donuts_cancel_centre_stays_readable:EveryLook()),DangerBrushon the centre (SurfaceBrushtinted withDangerBrushat 22%) has contrast of at least 3:1;Not checked