#9596

Docking: allow docking tab bars to opt out of the tab list scrolling buttons (e.g. for touch input)

Openab-toolsopened 18d ago

Version/Branch of Dear ImGui:

Version 1.92.9, Branch: docking (via Dear ImGui Bundle 1.92.900 Python bindings)

Back-ends:

imgui_impl_opengl3 + imgui_impl_glfw (desktop), plus our own remote renderer for a browser/phone view

Compiler, OS:

Windows 11, Linux, macOS (CPython 3.13)

Full config/build information:

No response

Details:

Allow docking tab bars to opt out of the tab list scrolling buttons (e.g. for touch input)

Follow-up to #8800 / #3421, where you mentioned being "absolutely open to it if still deemed useful". I think we have such a case.

Our app also runs in a browser on phones and tablets. There, the small < > scrolling buttons of a tab bar are nearly impossible to hit with a finger, so we scroll tab bars with a horizontal swipe instead: our input code writes tab_bar->ScrollingTarget / ScrollingAnim. That works well for docking tab bars too.

For our own tab bars we simply pass ImGuiTabBarFlags_NoTabListScrollingButtons while touch input is used. For docking tab bars, there is currently no way to do the same:

  • DockNodeUpdateTabBar() builds tab_bar_flags from scratch every frame. Even the // | ImGuiTabBarFlags_NoTabListScrollingButtons and "May expose later if needed (#8800, #3421)" comments are there.
  • The layout runs on the first TabItemEx() of that frame, so DockNodeBeginAmendTabBar() comes too late to change it.
  • Making the buttons invisible isn't possible either: they still take their width at the end of the bar.

The result is that the buttons are always shown on touch devices, eat bar width, and can't be used.

Suggestion

Any way to add tab bar flags to docking tab bars would solve it, for example:

  1. A dock node flag, e.g. ImGuiDockNodeFlags_NoTabListScrollingButtons (private or public), applied in DockNodeUpdateTabBar():
    if (node->MergedFlags & ImGuiDockNodeFlags_NoTabListScrollingButtons)
        tab_bar_flags |= ImGuiTabBarFlags_NoTabListScrollingButtons;

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

Activity

0

No activity yet.