imgui icon indicating copy to clipboard operation
imgui copied to clipboard

Docking: Added DockingSplitterSize to ImGuiStyle Struct

Open PossiblyAShrub opened this issue 3 years ago • 7 comments

I have personally preferred more spacing between my docked windows (ie. a larger docking splitter size) I also have noticed that I am not the only one wishing for this feature (see https://github.com/ocornut/imgui/issues/2109#issuecomment-636401292)

Previously I would simply change the DOCKING_SPLITTER_SIZE definition (in imgui.cpp), while this did work, it required me to change Dear ImGui source code.

All I've done is add the DockingSplitterSize field to the ImGuiStyle struct. Then I updated some of the docking code to use this new field. Finally I added a corresponding slider in the style editor. Here's a gif of the result:

5mCqKbswBo

PossiblyAShrub avatar Sep 20 '20 05:09 PossiblyAShrub

also useful for touch screens

mathisloge avatar Sep 21 '20 16:09 mathisloge

Hello @PossiblyAShrub and thanks for the PR.

The reason I didn't expose this value in style was that various mock-ups I received from users suggested that in some instances we also want an outer-most border using this same spacing value. Currently the way we use that value is for separator/splitter only. The larger we make the value, the more likely it is that a designer/UI/visual person will want outer spacing to follow.

I haven't dug much further yet but that's the general idea/reason why it's not yet done the way you suggested it.

ocornut avatar Sep 21 '20 18:09 ocornut

The reason I didn't expose this value in style was that various mock-ups I received from users suggested that in some instances we also want an outer-most border using this same spacing value. Currently the way we use that value is for separator/splitter only.

I'd suggest that we have a separate value for the outer-padding to allow more flexibility.

Now that I think about it, isn't there a way to do outer padding using the existing styling?

frink avatar Sep 24 '20 18:09 frink

I've added support for outer padding (in dock spaces only). I think the extra padding looks quite nice, and helps to decongest everything.

e2uwRdDwsT

Right now I've made a distinction between inner (between windows) and outer (between the dock space and docked windows.) I'm not sure if we want it this way, or perhaps they'd be better combined into one (as a float or ImVec2.)

PossiblyAShrub avatar Sep 26 '20 13:09 PossiblyAShrub

Right now I've made a distinction between inner (between windows) and outer (between the dock space and docked windows.) I'm not sure if we want it this way, or perhaps they'd be better combined into one (as a float or ImVec2.)

Looks beautiful! It's nice to have them separate for beautification's sake. (Most every tiling window manger keeps them separate too - so this convention is standard...) How is the outer padding styled? Can we make it transparent?

frink avatar Sep 27 '20 14:09 frink

cc: @ChristianIvicevic who expressed interested in this too.

ocornut avatar Sep 28 '20 20:09 ocornut

Will eventually merge this once I figure out how to configure it for outer vs inner bordering.

FYI NVIDIA Omniverse Kit client is also using thick spacing with a patch similar to this one: 102382588-e43bcc80-3fca-11eb-8792-e565293f0f9f

ocornut avatar Dec 16 '20 17:12 ocornut

I have now merged a5aff5fd3 + small amends b79751eb which basically constitute the first commit of your PR. Mostly this is in order to make the default value scale with scale.ScaleAllSizes() generally desirable for high-DPI.

I haven't merged the second commit: there's no handling of outer padding in floating dock node, which I believe might need to be a third exposed value. The main problem is that rendering that for floating dock node is a little more difficult than for dockspaces (where you found a single easy/suitable) change + we may need to clarify which colors are used where, as our attempt at it for dockspaces used WindowBg.

I'll close #2522 and #4721 but leave this open for now. Thanks!

ocornut avatar Jul 11 '23 10:07 ocornut