mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
settings: properly EndChild
This commit is contained in:
parent
a355ba863b
commit
9f32b05587
2 changed files with 27 additions and 26 deletions
|
|
@ -152,13 +152,13 @@ internal class SettingsWindow : Window
|
|||
settingsTab.OnOpen();
|
||||
}
|
||||
|
||||
if (ImGui.BeginChild($"###settings_scrolling_{settingsTab.Title}", new Vector2(-1, -1), false))
|
||||
{
|
||||
using var tabChild = ImRaii.Child(
|
||||
$"###settings_scrolling_{settingsTab.Title}",
|
||||
new Vector2(-1, -1),
|
||||
false);
|
||||
if (tabChild)
|
||||
settingsTab.Draw();
|
||||
}
|
||||
|
||||
ImGui.EndChild();
|
||||
}
|
||||
else if (settingsTab.IsOpen)
|
||||
{
|
||||
settingsTab.IsOpen = false;
|
||||
|
|
@ -207,7 +207,9 @@ internal class SettingsWindow : Window
|
|||
|
||||
ImGui.SetCursorPos(windowSize - ImGuiHelpers.ScaledVector2(70));
|
||||
|
||||
if (ImGui.BeginChild("###settingsFinishButton"))
|
||||
using (var buttonChild = ImRaii.Child("###settingsFinishButton"))
|
||||
{
|
||||
if (buttonChild)
|
||||
{
|
||||
using var disabled = ImRaii.Disabled(this.tabs.Any(x => x.Entries.Any(y => !y.IsValid)));
|
||||
|
||||
|
|
@ -231,8 +233,7 @@ internal class SettingsWindow : Window
|
|||
: Loc.Localize("DalamudSettingsSave", "Save changes"));
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(windowSize.X - 250, ImGui.GetTextLineHeightWithSpacing() + (ImGui.GetStyle().FramePadding.Y * 2)));
|
||||
ImGui.SetNextItemWidth(240);
|
||||
|
|
|
|||
|
|
@ -234,7 +234,9 @@ Contribute at: https://github.com/goatcorp/Dalamud
|
|||
{
|
||||
var windowSize = ImGui.GetWindowSize();
|
||||
|
||||
ImGui.BeginChild("scrolling", Vector2.Zero, false, ImGuiWindowFlags.NoScrollbar);
|
||||
using var child = ImRaii.Child("scrolling", new Vector2(-1, -10 * ImGuiHelpers.GlobalScale), false, ImGuiWindowFlags.NoScrollbar);
|
||||
if (!child)
|
||||
return;
|
||||
|
||||
if (this.resetNow)
|
||||
{
|
||||
|
|
@ -295,8 +297,6 @@ Contribute at: https://github.com/goatcorp/Dalamud
|
|||
}
|
||||
}
|
||||
|
||||
ImGui.EndChild();
|
||||
|
||||
base.Draw();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue