Skip to content

feat(window): add configurable separator_px#74

Open
roramirez wants to merge 1 commit into
mainfrom
feat/config-separator-width
Open

feat(window): add configurable separator_px#74
roramirez wants to merge 1 commit into
mainfrom
feat/config-separator-width

Conversation

@roramirez

Copy link
Copy Markdown
Owner

Summary

Adds a window.separator_px configuration option that controls the pixel width of the separator drawn between split panes. Previously this was a private const SEP: u32 = 1; in src/ui/layout.rs, threaded through the recursive layout methods and never DPI-scaled. The value is now resolved from config through Scale::chrome, so it is DPI-aware — the intended improvement over the fixed 1 physical px.

Changes

  • config: add separator_px: u32 (default 1) to WindowConfig with a serde default; preserve it verbatim through the TUI config panel round-trip.
  • assets/config.toml: document separator_px = 1 under [window].
  • ui/layout: thread a sep: u32 parameter through split_dimension, Node::compute_rects, Node::separators, and Node::find_sep_at_pixel; the *_scaled public wrappers now accept sep (like tab_h/status_h), keeping Layout stateless. Non-_scaled convenience methods still pass the SEP default.
  • App: add App::separator_px() returning Scale::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 a 0 config sane for hit-testing/rendering.
  • Tests: update layout_test to the parameterized API and add a sep = 3 test asserting a 3 px separator thickness and a 3 px B-child offset.
  • Docs: doc/SPEC.md configuration table, README.md [window] block, CHANGELOG.md Added.

How to test

  • cargo test — all tests pass (includes the new custom_sep_width_sets_thickness_and_offsets_b_child test).
  • cargo clippy --locked -- -D warnings — clean.
  • Manually: set separator_px = 4 in ~/.config/mmterm/config.toml, split a pane (Ctrl-W), and observe the wider gap; grabbing the separator to drag it still hit-tests correctly.

…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.
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