Repository navigation
Tidy the desktop paint editor layout - #12
Merged
Merged
Conversation
Rebuild the desktop layout around pill groups, a single-column tool rail and a bottom bar, in the style of the sound editor. The phone layout is unchanged. - Header: costume name, undo and redo, fill, outline and outline width, then the tools for the current mode. Two slim rows, or one row when the editor is wide enough. - Number fields get minus and plus buttons that repeat while held, in place of bare inputs. - Tool rail: one column with each tool's key shown on its button, and the less common shapes in a flyout that opens as a column beside the rail. - Bottom bar: a Vector and Bitmap switch, and a zoom readout that returns to 100% when clicked. - P selects the pen. - The brush shape and text alignment buttons now show which option is active. Version 0.2.0 to 0.3.0.
The number steppers now show the stepped value after typing, stop a held button when the field is switched off or the window loses focus, and land on whole steps from a fractional value. The shapes flyout opens upward so it stays inside the editor, closes on Escape, and no longer relies on a parent element carrying dir. Zoom and colour buttons get proper labels and keyboard focus.
The tool rail no longer sets a minimum height for the editor: it shrinks, folds into two columns when the window is short, and the editor scrolls as a last resort, so the bottom bar and the costume list stay reachable. The arrange buttons collapse into an Arrange menu when the editor is too narrow to show them beside the tool options, which keeps the header the same height in every tool. The bottom bar wraps instead of clipping its zoom buttons.
The Arrange menu that replaces the arrange buttons in narrow windows could only be opened with a pointer. The trigger is now a focusable button: Enter, Space or the down arrow open it on the first item, the arrow keys, Home and End move between items, Enter and Space run the focused item, and Escape or Tab close it and return focus to the trigger. Font menu items preview on focus the same way they do on hover. The Arrange menu also gets its divider on desktop, and the dark toolbar icon filter is limited to the desktop layout.
Opening the Arrange menu with the down arrow also nudged the selection, because the key carried on to the canvas tools. The trigger now handles its keys before they leave it. Focus rings on menu items sit inside the menu so a scrolling menu cannot clip them.
Opening a menu with the mouse left focus on its trigger, and closing a menu moved focus back there, so the down arrow reopened the menu instead of nudging the selection. Keyboard handling now only applies to a menu that was opened from the keyboard: a pointer click never leaves focus on the trigger and closing does not move focus. Holding the key that opened a menu no longer runs its first item, left and right move between items, shortcuts pass through, and the caret is hidden from the trigger's accessible name.
Font items are chosen by whatever was previewed last. A pointer resting over the open menu re-previews the item under it, so Enter on a focused font committed the hovered one. Running an item from the keyboard now previews it again first.
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.
The desktop paint editor gets a tidier layout that is quicker to use. The phone layout (600px wide and below) is unchanged.
What changed
Not in this pull request: typed position and size fields for the selection, and layers. Layers are the next step.
Version
0.2.0 to 0.3.0 (new feature, backwards compatible).
Merge order
Merge this before the scratch-gui pull request that pins it. Cloudflare builds of scratch-gui take the latest scratch-paint
develop, so the gui preview only shows this layout once this is merged. The gui pull request also removes old tablet rules that would clip the new tool rail between 601px and 900px.Checks
npx jest: 26 suites, 126 tests passnode scripts/check-conventions.mjs --base=origin/develop: oknpx webpack --bail: buildsScreenshots
Select tool, before and after:
Brush tool, before and after. Size and smoothing are typed fields with steppers:
Bitmap costume, before and after:
More shapes open in a column beside the rail:
Dark theme, vector and bitmap:
A very wide editor puts the whole header on one row:
A narrow editor (1024px window) moves the arrange actions into a menu:
The Arrange menu opened and driven from the keyboard:
A short editor (1280x640 window) folds the rail into two columns:
Steppers, the shapes flyout and the zoom readout in use: