Skip to content
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

Separators and indent #697

Closed
leiradel opened this issue Jun 14, 2016 · 2 comments
Closed

Separators and indent #697

leiradel opened this issue Jun 14, 2016 · 2 comments

Comments

@leiradel
Copy link

I'm not sure if it's by design, but separator lines don't respect the indentation:

lrcmdr

The code is:

const struct retro_system_info* info = s_Libretro.GetSystemInfo();
ImGui::Text( "System Info" );
ImGui::Indent( 16.0f );
Table(
  2,
  "library_name",     's', info->library_name,
  "library_version",  's', info->library_version,
  "valid_extensions", 's', info->valid_extensions,
  "need_fullpath",    'b', info->need_fullpath,
  "block_extract",    'b', info->block_extract,
  NULL
);
ImGui::Unindent( 16.0f );

The Table function just issues ImGui::Separator and ImGui::NextColumn at appropriate places, and never call the indentation functions.

@ocornut
Copy link
Owner

ocornut commented Jun 15, 2016

It was sort of by design as I think it looked weirder in some occasions when not doing that. I would have to give it another look.

In ImGui::Separator() you can try removing the if there:

    if (!window->DC.GroupStack.empty())
        x1 += window->DC.IndentX;

I think Separator() needs a redesign (amusing considering how trivial this it).

Related to #205
Also to Columns #513 and #125 perhaps even going as far as Splitters #319

At least, in the case of Columns perhaps it should be part of a new BeginColumns() api to specify how to draw borders then it that sort of situation you would need to add separators yourself.

So, I don't have an answer yet. You can play with the patch above see if you think it is better, or just leave it as is for now. You can as well just draw the lines or whatever you want yourself, using the ImDrawList API. It may be a bit cumbersome but a good workaround to avoid tackling the pending-design issue :)

@leiradel
Copy link
Author

If it's by design, I'll leave it be. Thanks.

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

No branches or pull requests

2 participants