mirror of
https://github.com/ocornut/imgui.git
synced 2026-10-29 07:54:40 +00:00
Invisible Scrollbar / Scrollbar visibility? #9548
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#9548
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.2, Branch: docking
Back-ends:
imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler, OS:
Windows11 MSVC 2022
Full config/build information:
Is it possible to replicate the scrolling behavior shown in the attached video?
Specifically, where the scrollbar only appears when the mouse hovers over its area, and it does not occupy its own dedicated space but instead overlays the content of the last column.
https://github.com/user-attachments/assets/82f6c1f6-b687-4e89-a9de-04844bb8fb21
Details:
My Issue/Question:
XXX (please provide as much context as possible)
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No, this is not supported.
My issue with implementing it is the following:
It does indeed prevent a whole category of problems (feedback loop between contents sizes and scrollbar visibility, e.g. #8488, #3285).
If it is exposed as a Style option, it raises the issue that we'd have a Style option can hide a whole category of problems, and then code written somewhere might break elsewhere if the style is different because it wasn't checked for feedback loop issues. That doesn't seem desirable for a healthy code sharing ecosystem.
So my gut feeling is that the only possible move would be to enforce a scheme everywhere where scrollbar visibility does not alter layout, which could be a choice between invisible and appearing over contents (as in your video), invisible and appearing next to contents (would work if thin enough). That's not a change I would make casually. Especially considering that technical profile/users tend to dislike non-visible scrollbars.
No, this is not supported.
My issue with implementing it is the following:
It does indeed prevent a whole category of problems (feedback loop between contents sizes and scrollbar visibility, e.g. #8488, #3285).
If it is exposed as a Style option, it raises the issue that we'd have a Style option can hide a whole category of problems, and then code written somewhere might break elsewhere if the style is different because it wasn't checked for feedback loop issues. That doesn't seem desirable for a healthy code sharing ecosystem.
So my gut feeling is that the only possible move would be to enforce a scheme everywhere where scrollbar visibility does not alter layout, which could be a choice between invisible and appearing over contents (as in your video), invisible and appearing next to contents (would work if thin enough). That's not a change I would make casually. Especially considering that technical profile/users tend to dislike non-visible scrollbars.
There is a way how to achieve something similar. Set scrollbar size to zero:
ImGui::PushStyleVar(ImGuiStyleVar_ScrollbarSize, 0). Then upon mouse dragging resetwindow->ScrollbarSizeand draw it again usingImGui::Scrollbar. ImRAD generates the required code whenscrollWhenDraggingtable property is set.