Repository navigation
feat(theme): a cell density, for a renderer that paints into a terminal's cells - #10
Merged
Merged
Conversation
…al's cells Density::Cell makes every row a menu or a dialog has one cell high (24px, Metrics::CELL and menu::Sizes::CELL, kept in step with the stylesheet by the existing test), with square corners and no shadows. A menu's padding leaves a row above and below its items for the border. The host sets Theme::font to its monospace face. Theme gains a `cell` field, so a Theme written out field by field needs it added.
Sizes gains margin and overlap, 4px each for the pointer and touch densities as before. The cell density keeps to the grid: no margin, a submenu overlapping its parent by one cell, and a pad that counts the 1px border, so a level is exactly as tall as its rows. Sizes gains two fields, so a Sizes written out field by field needs them added.
↑ and ↓ (or Tab and ⇧Tab) move a highlight through the sheet's actions that can be chosen and its Cancel, round from the end; Return or Space chooses the one highlighted. Until a key moves it nothing is highlighted, so Return on a sheet just opened still does nothing. The cell density centres the sheet and gives each action one row. ActionSheet gains a `hot` field, so a sheet written out field by field needs it added. Behavioural-change: an open action sheet acts on ↑, ↓, Tab, Return and Space, which it used to swallow.
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.
For leaf's terminal prototype (diaryx-org/leaf#20), which paints a Blitz page into character cells and puts unit's menus and dialogs round the editor, as the Mac app does.
Density::Cell: every row a menu or a dialog has is one cell (24px) high, in the host's monospaceTheme::font, with square corners and no shadows.Metrics::CELLandmenu::Sizes::CELLare kept in step with the stylesheet by the existing test.Sizesgainsmarginandoverlap, 4px each for the pointer and touch densities as before. The cell density keeps to the grid: no margin, and a submenu overlapping its parent by one cell.Unit::hot_firstis public, for a host that opens a menu from a key.Theme,SizesandActionSheeteach gain a field, so one written out field by field needs it added.Checks:
ship ci(fmt, clippy, web clippy, tests, docs) passes.