Skip to content

Commit

Permalink
Add HorizontalLine to Title attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
vanifatovvlad committed Mar 12, 2023
1 parent abcd8b1 commit ec71246
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Editor.Extras/Drawers/TitleDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ public override void OnGUI(Rect position, TriProperty property, TriElement next)

var title = _titleResolver.GetValue(property, "Error");
GUI.Label(titleRect, title, EditorStyles.boldLabel);
EditorGUI.DrawRect(lineRect, Color.gray);

if (Attribute.HorizontalLine)
{
EditorGUI.DrawRect(lineRect, Color.gray);
}

next.OnGUI(contentRect);
}
Expand Down
1 change: 1 addition & 0 deletions Runtime/Attributes/TitleAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace TriInspector
public sealed class TitleAttribute : Attribute
{
public string Title { get; }
public bool HorizontalLine { get; set; } = true;

public TitleAttribute(string title)
{
Expand Down

0 comments on commit ec71246

Please sign in to comment.