mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +01:00
fix: use ImRaii for PI DrawPluginCategories
Prevents mismatched BeginTable/EndTable
This commit is contained in:
parent
a954e83976
commit
c68793b589
1 changed files with 27 additions and 32 deletions
|
|
@ -1110,11 +1110,14 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
|
||||
var useContentWidth = ImGui.GetContentRegionAvail().X;
|
||||
|
||||
if (ImGui.BeginChild("InstallerCategories", new Vector2(useContentWidth, useContentHeight * ImGuiHelpers.GlobalScale)))
|
||||
{
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.CellPadding, ImGuiHelpers.ScaledVector2(5, 0));
|
||||
if (ImGui.BeginTable("##InstallerCategoriesCont", 2, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.Resizable | ImGuiTableFlags.BordersInnerV))
|
||||
using (ImRaii.Child("InstallerCategories", new Vector2(useContentWidth, useContentHeight * ImGuiHelpers.GlobalScale)))
|
||||
{
|
||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.CellPadding, ImGuiHelpers.ScaledVector2(5, 0));
|
||||
using var table = ImRaii.Table(
|
||||
"##InstallerCategoriesCont",
|
||||
2,
|
||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.Resizable | ImGuiTableFlags.BordersInnerV);
|
||||
|
||||
try
|
||||
{
|
||||
ImGui.TableSetupColumn("##InstallerCategoriesSelector", ImGuiTableColumnFlags.WidthFixed, useMenuWidth * ImGuiHelpers.GlobalScale);
|
||||
|
|
@ -1125,7 +1128,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
this.DrawPluginCategorySelectors();
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
if (ImGui.BeginChild("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.NoBackground))
|
||||
using (ImRaii.Child("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.NoBackground))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -1136,19 +1139,11 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
Log.Error(ex, "Could not draw category content");
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.EndChild();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Could not draw plugin categories");
|
||||
}
|
||||
|
||||
ImGui.EndTable();
|
||||
}
|
||||
|
||||
ImGui.PopStyleVar();
|
||||
ImGui.EndChild();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue