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

Open
opened 2026-10-26 17:31:52 +00:00 by ab-tools · 2 comments
ab-tools commented 2026-10-26 17:31:52 +00:00 (Migrated from github.com)

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

### 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()`: ```cpp if (node->MergedFlags & ImGuiDockNodeFlags_NoTabListScrollingButtons) tab_bar_flags |= ImGuiTabBarFlags_NoTabListScrollingButtons; ### Screenshots/Video: _No response_ ### Minimal, Complete and Verifiable Example code: _No response_
ocornut commented 2026-11-24 16:46:17 +00:00 (Migrated from github.com)

I have pushed d613c9f with adds a g.ConfigDockingTabBarFlags to configure this (requires imgui_internal.h)
E.g. g.ConfigDockingTabBarFlags |= ImGuiTabBarFlags_NoTabListScrollingButtons;

Adding this to facilitate stuff like this, but deep down I don't think this it the right solution. If we want to use ImGuiTabBarFlags_NoTabListScrollingButtons because touch screen makes them hard to use they should be enforced globally rather than in dock node tab bars, so this might as well be a ImGuiStyle option? But then making this configurable puts code at risk that relying on default might be occasionally unreliable.

I however prefer adding this now at it is closer the right solution, rather than exposing another layer in ImGuiWindowClass or ImGuiDockNode. Docking V3 would hopefully simplify and clarify how to configure those things but it is difficult to find the right design.

I have pushed d613c9f with adds a `g.ConfigDockingTabBarFlags` to configure this (requires imgui_internal.h) E.g. `g.ConfigDockingTabBarFlags |= ImGuiTabBarFlags_NoTabListScrollingButtons;` Adding this to facilitate stuff like this, but deep down I don't think this it the right solution. If we want to use `ImGuiTabBarFlags_NoTabListScrollingButtons` because touch screen makes them hard to use they should be enforced globally rather than in dock node tab bars, so this might as well be a ImGuiStyle option? But then making this configurable puts code at risk that relying on default might be occasionally unreliable. I however prefer adding this now at it is closer the right solution, rather than exposing another layer in ImGuiWindowClass or ImGuiDockNode. Docking V3 would hopefully simplify and clarify how to configure those things but it is difficult to find the right design.
ab-tools commented 2026-11-24 17:37:48 +00:00 (Migrated from github.com)

Thanks, @ocornut, much appreciated!

Thanks, @ocornut, much appreciated!
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#9596
No description provided.