8000 Docking: Added DockingSplitterSize to ImGuiStyle Struct by PossiblyAShrub · Pull Request #3481 · ocornut/imgui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Docking: Added DockingSplitterSize to ImGuiStyle Struct #3481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: docking
Choose a base branch
from

Conversation

PossiblyAShrub
Copy link

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 #2109 (comment))

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

@mathisloge
Copy link

also useful for touch screens

@ocornut
Copy link
Owner
ocornut commented Sep 21, 2020

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.

@frink
Copy link
Contributor
frink commented Sep 24, 2020

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?

@PossiblyAShrub
Copy link
Author

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.)

@frink
Copy link
Contributor
frink commented Sep 27, 2020

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?

@ocornut
Copy link
Owner
ocornut commented Sep 28, 2020

cc: @ChristianIvicevic who expressed interested in this too.

@ocornut ocornut force-pushed the docking branch 2 times, most recently from 4a6447b to 6822493 Compare October 8, 2020 14:06
@ocornut
Copy link
Owner
ocornut commented Dec 16, 2020

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 pushed a commit that referenced this pull request Jul 11, 2023
(DockingSplitterSize in current commit, about to be renamed)
ocornut added a commit that referenced this pull request Jul 11, 2023
…2522)

Add ImGuiStyleVar_DockingSeparatorSize + misc Docking related comments.
@ocornut
Copy link
Owner
ocornut commented Jul 11, 2023

I have now merged a5aff5f + small amends b79751e 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 ocornut closed this Jul 11, 2023
@ocornut ocornut reopened this Jul 11, 2023
@ocornut ocornut mentioned this pull request Feb 7, 2024
@pixtur
Copy link
pixtur commented Jul 11, 2024

I also spent a lot of time tweaking various style parameters to achieve this until I stumbled over this thread.
On a side note, I was kind of surprised that WindowPadding seems only to be used when WindowBorderSize is not 0.

@ocornut
Copy link
Owner
ocornut commented Jul 11, 2024

On a side note, I was kind of surprised that WindowPadding seems only to be used when WindowBorderSize is not 0.

That’s not true.

@pixtur
Copy link
pixtur commented Jul 11, 2024

To be honest, answers like this one are the reason why I avoid posting here. It makes me feel stupid.

Anyways. This is how it looks on my side...

2024-07-11.20-02-04-1.mp4

@ocornut
Copy link
Owner
ocornut commented Jul 11, 2024

To be honest, answers like this one are the reason why I avoid posting here. It makes me feel stupid.

I must apologize. the intent is never to make anyone feel stupid. But we answer many messages and don't always have time to massage them in feedback sandwich, and I tend to try to focus on cold facts. And in fact I happen to be wrong occasionally. In this precise situation: I was the "stupid" (or wrong) one since your statement is actually true at least in the situation which matters to you here.

Only for BeginChild(): I thought it relied on ImGuiChildFlags_Border (previously bool border param to BeginChild() but it specifically checks BorderSize==0.0f to disable WindowPadding by default. So you are correct. But we have a ImGuiChildFlags_AlwaysUseWindowPadding flag (previously ImGuiWindowFlags_AlwaysUseWindowPadding, perhaps in your older version) to enforce using padding.

In fact I think I should go and make this selection based on ImGuiChildFlags_Border "input" rather than the final value of BorderSize.

@pixtur
Copy link
pixtur commented Jul 11, 2024

ImGuiWindowFlags_AlwaysUseWindowPadding is precisely what I have missed and it works like a charm (I personally would have expected this to be true by default, though).

I'm sorry for my earlier remark. I had a rough day and was slightly thin skinned. And yes, I should have started a new issue with proper code example instead of writing a comment without any meaningful context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0