Skip to content

Add vertical tab bars on the left and right#9855

Draft
bvolpato wants to merge 1 commit intokovidgoyal:masterfrom
bvolpato:bvolpato/vertical-tab-bar-side
Draft

Add vertical tab bars on the left and right#9855
bvolpato wants to merge 1 commit intokovidgoyal:masterfrom
bvolpato:bvolpato/vertical-tab-bar-side

Conversation

@bvolpato
Copy link
Copy Markdown

Summary

Add real side tab bars by teaching tab_bar_edge about left and right and rendering tabs as a vertical sidebar.

Changes

  • add left and right values to tab_bar_edge
  • allocate left/right tab bar regions in native window geometry
  • render side tabs as a vertical multi-line tab bar with row-based hit testing
  • route tab drag/drop targeting through the vertical axis when the tab bar is on the side
  • add focused tests for config parsing and vertical tab bar hit testing

Testing

  • python3 -m py_compile kitty/tab_bar.py kitty/tabs.py kitty/boss.py kitty/options/utils.py kitty/options/definition.py kitty_tests/options.py kitty_tests/tab_bar.py
  • attempted ./dev.sh build --debug, but this environment does not have the Linux X11/OpenGL development headers needed for kitty's native build (x11.pc and related headers were missing)

Repro / Manual Check

Use a config like:

 tab_bar_edge left
 tab_bar_style separator
 tab_bar_show_new_tab_button yes

Open several tabs and verify:

  • tabs render in a left sidebar
  • clicking anywhere on a sidebar row activates the tab
  • dragging tabs reorders them vertically
  • dragging a window onto a sidebar row moves it into that tab

Refs #2305

Teach tab_bar_edge about left and right sidebars and route tab layout,
hit-testing, and drag/drop through the vertical axis when needed.
@kovidgoyal
Copy link
Copy Markdown
Owner

Will review actual code when I have more time. Just as an initial comment,
the intent of tab_bar_align is to align tabs at the start, center or
end. It should have the same semantics for vertical tab bars. Make the
accepted values start, center, end, left, right (with left and right
being synonyms for start, end. And have the vertical tabs drawn at the
top/middle/bottom accordingly. I dont really think a setting for
controlling halign is needed.

Also, at a more meta level, for vertical tabs it should be possible to
render them in two or more lines, the number of lines being reduced as
more tabs are added and just as in the horizontal case tabs are made
narrower as the number increases.

From a UI perspective, it might make sense to leave a blank line between
tabs to separate them. I dont know if you do that already havent
actually tested it yet.

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.

2 participants