Simplify ImGuiListClipper initialization

This commit is contained in:
Haselnussbomber 2025-07-17 01:54:40 +02:00
parent d25b16aa93
commit a1b8dbcf27
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
7 changed files with 12 additions and 31 deletions

View file

@ -112,10 +112,7 @@ internal class ConsoleWindow : Window, IDisposable
this.configuration.DalamudConfigurationSaved += this.OnDalamudConfigurationSaved;
unsafe
{
this.clipperPtr = new(ImGui.ImGuiListClipper());
}
this.clipperPtr = ImGui.ImGuiListClipper();
}
/// <summary>Gets the queue where log entries that are not processed yet are stored.</summary>

View file

@ -190,7 +190,7 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget
var addon = Service<DataManager>.GetNullable()?.GetExcelSheet<Addon>() ??
throw new InvalidOperationException("Addon sheet not loaded.");
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
var clipper = ImGui.ImGuiListClipper();
clipper.Begin(addon.Count);
while (clipper.Step())
{

View file

@ -449,7 +449,7 @@ internal class TexWidget : IDataWindowWidget
sortSpecs.SpecsDirty = false;
}
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
var clipper = ImGui.ImGuiListClipper();
clipper.Begin(allBlames.Count);
while (clipper.Step())
@ -538,7 +538,7 @@ internal class TexWidget : IDataWindowWidget
(ImGui.GetStyle().ItemSpacing.X * 1 * numIcons));
ImGui.TableHeadersRow();
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
var clipper = ImGui.ImGuiListClipper();
clipper.Begin(textures.Count);
using (var enu = textures.GetEnumerator())

View file

@ -64,7 +64,7 @@ internal class UiColorWidget : IDataWindowWidget
ImGui.TableSetupColumn("Clear Blue", ImGuiTableColumnFlags.WidthFixed, colorw);
ImGui.TableHeadersRow();
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
var clipper = ImGui.ImGuiListClipper();
clipper.Begin(colors.Count, ImGui.GetFrameHeightWithSpacing());
while (clipper.Step())
{