zwcloud / ImGui

Immediate Mode GUI for C#
https://zwcloud.net/#project/imgui
GNU Affero General Public License v3.0
197 stars 21 forks source link

The order of controls inside a CollapsingHeader, which is initially closed, is inverted. #57

Closed zwcloud closed 4 years ago

zwcloud commented 4 years ago
bool headerOn = false;
//...
if (GUILayout.CollapsingHeader("Header", ref headerOn))
{
    GUILayout.Button("Button A");
    GUILayout.Button("Button B");
    GUILayout.Button("Button C");
}

After opening the CollapsingHeader: image

zwcloud commented 4 years ago

same issue for dynamically added label:

for (int i = 0; i < clickCount; i++)
{
    GUILayout.Label($"Some Text {i}");
}

if (GUILayout.Button("Click"))
{
    clickCount++;
}

incorrect_order

The label should be added before the button, not after it.

zwcloud commented 4 years ago

Fixed image image