Separators and indent #697

Closed
opened 2016-06-14 18:14:56 +00:00 by leiradel · 2 comments
leiradel commented 2016-06-14 18:14:56 +00:00 (Migrated from github.com)

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.

I'm not sure if it's by design, but separator lines don't respect the indentation: ![lrcmdr](https://cloud.githubusercontent.com/assets/357536/16054102/1351a2f6-3242-11e6-87d2-561147e7e66e.png) The code is: ``` C++ 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 commented 2016-06-15 08:17:24 +00:00 (Migrated from github.com)

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 https://github.com/ocornut/imgui/issues/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 :)

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 https://github.com/ocornut/imgui/issues/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 commented 2016-06-15 10:24:00 +00:00 (Migrated from github.com)

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

If it's by design, I'll leave it be. Thanks.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#697
No description provided.