mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-29 00:52:31 +00:00
Docking: allow docking tab bars to opt out of the tab list scrolling buttons (e.g. for touch input) #9596
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#9596
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 writestab_bar->ScrollingTarget/ScrollingAnim. That works well for docking tab bars too.For our own tab bars we simply pass
ImGuiTabBarFlags_NoTabListScrollingButtonswhile touch input is used. For docking tab bars, there is currently no way to do the same:DockNodeUpdateTabBar()buildstab_bar_flagsfrom scratch every frame. Even the// | ImGuiTabBarFlags_NoTabListScrollingButtonsand "May expose later if needed (#8800, #3421)" comments are there.TabItemEx()of that frame, soDockNodeBeginAmendTabBar()comes too late to change it.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:
ImGuiDockNodeFlags_NoTabListScrollingButtons(private or public), applied inDockNodeUpdateTabBar():Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
I have pushed
d613c9fwith adds ag.ConfigDockingTabBarFlagsto 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_NoTabListScrollingButtonsbecause 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.
Thanks, @ocornut, much appreciated!