fix: use ImRaii conditions properly

This commit is contained in:
goat 2023-06-21 20:30:34 +02:00
parent 00fd9079a9
commit 30176e61f5
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -1110,7 +1110,8 @@ internal class PluginInstallerWindow : Window, IDisposable
var useContentWidth = ImGui.GetContentRegionAvail().X;
using (ImRaii.Child("InstallerCategories", new Vector2(useContentWidth, useContentHeight * ImGuiHelpers.GlobalScale)))
using var categoriesChild = ImRaii.Child("InstallerCategories", new Vector2(useContentWidth, useContentHeight * ImGuiHelpers.GlobalScale));
if (categoriesChild)
{
using var style = ImRaii.PushStyle(ImGuiStyleVar.CellPadding, ImGuiHelpers.ScaledVector2(5, 0));
using var table = ImRaii.Table(
@ -1118,6 +1119,8 @@ internal class PluginInstallerWindow : Window, IDisposable
2,
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.Resizable | ImGuiTableFlags.BordersInnerV);
if (table)
{
try
{
ImGui.TableSetupColumn("##InstallerCategoriesSelector", ImGuiTableColumnFlags.WidthFixed, useMenuWidth * ImGuiHelpers.GlobalScale);
@ -1128,7 +1131,10 @@ internal class PluginInstallerWindow : Window, IDisposable
this.DrawPluginCategorySelectors();
ImGui.TableNextColumn();
using (ImRaii.Child("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.NoBackground))
using var scrollingChild =
ImRaii.Child("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.NoBackground);
if (scrollingChild)
{
try
{
@ -1146,6 +1152,7 @@ internal class PluginInstallerWindow : Window, IDisposable
}
}
}
}
private void DrawPluginCategorySelectors()
{
@ -2363,7 +2370,7 @@ internal class PluginInstallerWindow : Window, IDisposable
var isLoadedAndUnloadable = plugin.State == PluginState.Loaded ||
plugin.State == PluginState.DependencyResolutionFailed;
StyleModelV1.DalamudStandard.Push();
//StyleModelV1.DalamudStandard.Push();
var profileChooserPopupName = $"###pluginProfileChooser{plugin.Manifest.InternalName}";
if (ImGui.BeginPopup(profileChooserPopupName))
@ -2526,7 +2533,7 @@ internal class PluginInstallerWindow : Window, IDisposable
}
}
StyleModelV1.DalamudStandard.Pop();
//StyleModelV1.DalamudStandard.Pop();
ImGui.SameLine();
ImGuiHelpers.ScaledDummy(15, 0);