Fix begin/end child and window.

This commit is contained in:
Ottermandias 2021-09-01 21:57:37 +02:00
parent 52108d6198
commit 8a355e3905
4 changed files with 19 additions and 29 deletions

View file

@ -43,12 +43,8 @@ namespace Penumbra.UI
ImGui.SetNextWindowPos( ss - WindowPosOffset, ImGuiCond.Always ); ImGui.SetNextWindowPos( ss - WindowPosOffset, ImGuiCond.Always );
if( !ImGui.Begin( MenuButtonsName, ButtonFlags ) ) if( ImGui.Begin( MenuButtonsName, ButtonFlags )
{ && ImGui.Button( MenuButtonLabel, WindowSize ) )
return;
}
if( ImGui.Button( MenuButtonLabel, WindowSize ) )
{ {
_base.FlipVisibility(); _base.FlipVisibility();
} }

View file

@ -254,6 +254,7 @@ namespace Penumbra.UI
{ {
if( !ImGui.BeginChild( "##CollectionChild", AutoFillSize, true ) ) if( !ImGui.BeginChild( "##CollectionChild", AutoFillSize, true ) )
{ {
ImGui.EndChild();
return; return;
} }
@ -285,7 +286,6 @@ namespace Penumbra.UI
} }
DrawNewCharacterCollection(); DrawNewCharacterCollection();
ImGui.EndChild(); ImGui.EndChild();
} }
@ -296,21 +296,18 @@ namespace Penumbra.UI
return; return;
} }
if( !ImGui.BeginChild( "##CollectionHandling", new Vector2( -1, ImGui.GetTextLineHeightWithSpacing() * 6 ), true ) ) if( ImGui.BeginChild( "##CollectionHandling", new Vector2( -1, ImGui.GetTextLineHeightWithSpacing() * 6 ), true ) )
{ {
ImGui.EndTabItem();
return;
}
DrawCurrentCollectionSelector( true ); DrawCurrentCollectionSelector( true );
ImGui.Dummy( new Vector2( 0, 10 ) ); ImGui.Dummy( new Vector2( 0, 10 ) );
DrawNewCollectionInput(); DrawNewCollectionInput();
}
ImGui.EndChild(); ImGui.EndChild();
DrawCharacterCollectionSelectors(); DrawCharacterCollectionSelectors();
ImGui.EndTabItem(); ImGui.EndTabItem();
} }
} }

View file

@ -504,12 +504,8 @@ namespace Penumbra.UI
try try
{ {
var ret = ImGui.BeginChild( LabelModPanel, AutoFillSize, true ); var ret = ImGui.BeginChild( LabelModPanel, AutoFillSize, true );
if( !ret )
{
return;
}
if( Mod == null ) if( !ret || Mod == null )
{ {
ImGui.EndChild(); ImGui.EndChild();
return; return;

View file

@ -764,15 +764,16 @@ namespace Penumbra.UI
ImGui.PushStyleVar( ImGuiStyleVar.ItemSpacing, Vector2.Zero ); ImGui.PushStyleVar( ImGuiStyleVar.ItemSpacing, Vector2.Zero );
ImGui.BeginGroup(); ImGui.BeginGroup();
// Inlay selector list // Inlay selector list
ImGui.BeginChild( LabelSelectorList, if( ImGui.BeginChild( LabelSelectorList,
new Vector2( SelectorPanelWidth * _selectorScalingFactor, -ImGui.GetFrameHeightWithSpacing() ), new Vector2( SelectorPanelWidth * _selectorScalingFactor, -ImGui.GetFrameHeightWithSpacing() ),
true, ImGuiWindowFlags.HorizontalScrollbar ); true, ImGuiWindowFlags.HorizontalScrollbar ) )
{
ImGui.PushStyleVar( ImGuiStyleVar.IndentSpacing, 12.5f ); ImGui.PushStyleVar( ImGuiStyleVar.IndentSpacing, 12.5f );
var modIndex = 0; var modIndex = 0;
DrawFolderContent( _modManager.StructuredMods, ref modIndex ); DrawFolderContent( _modManager.StructuredMods, ref modIndex );
ImGui.PopStyleVar(); ImGui.PopStyleVar();
}
ImGui.EndChild(); ImGui.EndChild();