feat(window): add configurable separator_px#74
Open
roramirez wants to merge 1 commit into
Open
Conversation
…tor width Thread a runtime `sep` width through the layout tree (split_dimension, compute_rects, separators, find_sep_at_pixel) and the public Layout wrappers instead of the private `SEP` const. The App resolves it from config via `Scale::chrome`, making the separator DPI-aware. `.max(1)` guards against a 0 config for hit-testing and rendering.
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.
Summary
Adds a
window.separator_pxconfiguration option that controls the pixel width of the separator drawn between split panes. Previously this was a privateconst SEP: u32 = 1;insrc/ui/layout.rs, threaded through the recursive layout methods and never DPI-scaled. The value is now resolved from config throughScale::chrome, so it is DPI-aware — the intended improvement over the fixed 1 physical px.Changes
config: addseparator_px: u32(default1) toWindowConfigwith a serde default; preserve it verbatim through the TUI config panel round-trip.assets/config.toml: documentseparator_px = 1under[window].ui/layout: thread asep: u32parameter throughsplit_dimension,Node::compute_rects,Node::separators, andNode::find_sep_at_pixel; the*_scaledpublic wrappers now acceptsep(liketab_h/status_h), keepingLayoutstateless. Non-_scaledconvenience methods still pass theSEPdefault.App::separator_px()returningScale::chrome(config.window.separator_px).max(1)and route it to every layout-wrapper caller (pane ops, input ops, mouse ops, views, render ops, app event)..max(1)keeps a0config sane for hit-testing/rendering.layout_testto the parameterized API and add asep = 3test asserting a 3 px separator thickness and a 3 px B-child offset.doc/SPEC.mdconfiguration table,README.md[window]block,CHANGELOG.mdAdded.How to test
cargo test— all tests pass (includes the newcustom_sep_width_sets_thickness_and_offsets_b_childtest).cargo clippy --locked -- -D warnings— clean.separator_px = 4in~/.config/mmterm/config.toml, split a pane (Ctrl-W), and observe the wider gap; grabbing the separator to drag it still hit-tests correctly.