TylerTemp/SaintsField

[Request] More ELayout.Horizontal options and Customizable backgrounds

Closed this issue · 3 comments

  1. Horizontal layout options
    One of the common uses for a Horizontal layout is drawing fields in a table-like fashion.
    Currently there's no control over how horizontal fields placed and spaced.
    Unity_2024-11-27_10-28-35

    In TriInspector there's [DeclareHorizontalGroup] that allows passing an array of field sizes:
    Unity_2024-11-27_09-50-10
    (Note the gradient field: with SaintsField it's squeezed into 1 pix)
    Having controls like this would be great.

  2. Customizable background color of elements
    [GUIColor] is a very handy attribute in TriInspector allowing to color any element backgrounds (like in pic above).

Again, amazing work has been done on this package, it's so close to perfection.

Hi,

GUIColor has been added in 3.10.0

For everything about this issue, please see this list for a tracking progress

  • Horizontal Layout
  • GUIColor
    • GUIColor for single field
    • GUIColorStart & GUIColorEnd for multiple fields
  • Data Table for list/array of struct/class

Hi,

Currently, the Horizental Layout has some issue if the label is on, and it indeed needs an option to set width of different fields.

However, if we're talking about null label situation, when I set it up the field didn't squeezed, but use shared space evenly (SaintsField 3.10.0).

[Serializable]
public struct Info
{
    [LayoutStart("root", ELayout.Horizontal)]

    [RichLabel(null)] public Gradient gradient;
    [RichLabel(null)]
    public int i;
    [RichLabel(null)]
    public string thisIsALongDriveForPeopleWithNothingToThinkAbout;
}

[SaintsRow(inline: true), PlayaRichLabel("<color=pink><label/>")] public Info[] inputs;

I indeed adjusted how Layout organize field in UI Toolkit in some updates. Can you give a piece of code that the display is squeezed?

image

Thanks, great work (and fast too!). No squeezing now, I think I've used "" in [RichLabel] instead of null in that example.
Can't (actually can - it's not urgent) wait for custom widths.