mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +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,45 +1110,40 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
|
||||
var useContentWidth = ImGui.GetContentRegionAvail().X;
|
||||
|
||||
if (ImGui.BeginChild("InstallerCategories", new Vector2(useContentWidth, useContentHeight * ImGuiHelpers.GlobalScale)))
|
||||
using (ImRaii.Child("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 var style = ImRaii.PushStyle(ImGuiStyleVar.CellPadding, ImGuiHelpers.ScaledVector2(5, 0));
|
||||
using var table = ImRaii.Table(
|
||||
"##InstallerCategoriesCont",
|
||||
2,
|
||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.Resizable | ImGuiTableFlags.BordersInnerV);
|
||||
|
||||
try
|
||||
{
|
||||
try
|
||||
ImGui.TableSetupColumn("##InstallerCategoriesSelector", ImGuiTableColumnFlags.WidthFixed, useMenuWidth * ImGuiHelpers.GlobalScale);
|
||||
ImGui.TableSetupColumn("##InstallerCategoriesBody", ImGuiTableColumnFlags.WidthStretch);
|
||||
ImGui.TableNextRow();
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
this.DrawPluginCategorySelectors();
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
using (ImRaii.Child("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.NoBackground))
|
||||
{
|
||||
ImGui.TableSetupColumn("##InstallerCategoriesSelector", ImGuiTableColumnFlags.WidthFixed, useMenuWidth * ImGuiHelpers.GlobalScale);
|
||||
ImGui.TableSetupColumn("##InstallerCategoriesBody", ImGuiTableColumnFlags.WidthStretch);
|
||||
ImGui.TableNextRow();
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
this.DrawPluginCategorySelectors();
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
if (ImGui.BeginChild("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.NoBackground))
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
this.DrawPluginCategoryContent();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Could not draw category content");
|
||||
}
|
||||
this.DrawPluginCategoryContent();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
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();
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Could not draw plugin categories");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue