TreeNode,CollapsingHeader: sizing fixes to support laying out item on same line before/after (#414, #282)

This commit is contained in:
ocornut
2015-11-29 20:35:58 +00:00
parent 546962351b
commit 4006fb77bc
2 changed files with 26 additions and 25 deletions

View File

@ -2191,16 +2191,15 @@ static void ShowExampleAppPropertyEditor(bool* opened)
ImGui::Columns(2);
ImGui::Separator();
ImGui::Text("Item1"); ImGui::NextColumn();
ImGui::Text("value1"); ImGui::NextColumn();
struct funcs
{
static void ShowDummyObject(const char* prefix, ImU32 uid)
{
ImGui::PushID(uid); // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID.
ImGui::PushID(uid); // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID.
ImGui::AlignFirstTextHeightToWidgets(); // Text and Tree nodes are less high than regular widgets, here we add vertical spacing to make the tree lines equal high.
bool opened = ImGui::TreeNode("Object", "%s_%u", prefix, uid);
ImGui::NextColumn();
ImGui::AlignFirstTextHeightToWidgets();
ImGui::Text("my sailor is rich");
ImGui::NextColumn();
if (opened)