Fix automated design rows.

This commit is contained in:
Ottermandias 2023-09-28 21:59:14 +02:00
parent 66f040ffa8
commit 6e59ad0f1a

View file

@ -151,9 +151,15 @@ public class SetPanel
+ 150 * ImGuiHelpers.GlobalScale;
var singleRow = ImGui.GetContentRegionAvail().X >= requiredSizeOneLine || numSpacing == 0;
var numRows = (singleRow, _config.ShowUnlockedItemWarnings) switch
{
(true, true) => 6,
(true, false) => 5,
(false, true) => 5,
(false, false) => 4,
};
using var table = ImRaii.Table("SetTable", singleRow && _config.ShowUnlockedItemWarnings ? 6 : 5,
ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollX | ImGuiTableFlags.ScrollY);
using var table = ImRaii.Table("SetTable", numRows, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollX | ImGuiTableFlags.ScrollY);
if (!table)
return;
@ -184,6 +190,7 @@ public class SetPanel
if (_config.ShowUnlockedItemWarnings)
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, 2 * ImGui.GetFrameHeight() + 4 * ImGuiHelpers.GlobalScale);
ImGui.TableHeadersRow();
foreach (var (design, idx) in Selection.Designs.WithIndex())
{