mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
34 lines
765 B
C#
34 lines
765 B
C#
using ImGuiNET;
|
|
|
|
namespace Dalamud.Interface.Table;
|
|
|
|
public class Column<TItem>
|
|
{
|
|
public string Label = string.Empty;
|
|
public ImGuiTableColumnFlags Flags = ImGuiTableColumnFlags.NoResize;
|
|
|
|
public virtual float Width
|
|
=> -1f;
|
|
|
|
public string FilterLabel
|
|
=> $"##{this.Label}Filter";
|
|
|
|
public virtual bool DrawFilter()
|
|
{
|
|
ImGui.AlignTextToFramePadding();
|
|
ImGui.TextUnformatted(this.Label);
|
|
return false;
|
|
}
|
|
|
|
public virtual bool FilterFunc(TItem item)
|
|
=> true;
|
|
|
|
public virtual int Compare(TItem lhs, TItem rhs)
|
|
=> 0;
|
|
|
|
public virtual void DrawColumn(TItem item, int idx)
|
|
{ }
|
|
|
|
public int CompareInv(TItem lhs, TItem rhs)
|
|
=> this.Compare(rhs, lhs);
|
|
}
|