This commit is contained in:
2021-06-13 10:28:03 +02:00
parent eb70603c85
commit df2d24cbd3
7487 changed files with 943244 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
using UnityEngine;
using UnityEngine.U2D.Common;
using UnityEngine.UIElements;
namespace UnityEditor.U2D.Animation
{
internal class Toolbar : VisualElement
{
public class ToolbarFactory : UxmlFactory<Toolbar, ToolbarUxmlTraits> {}
public class ToolbarUxmlTraits : UxmlTraits {}
public Toolbar()
{
AddToClassList("Toolbar");
styleSheets.Add(ResourceLoader.Load<StyleSheet>("SkinningModule/ToolbarStyle.uss"));
if (EditorGUIUtility.isProSkin)
AddToClassList("Dark");
}
public void SetButtonChecked(Button toCheck)
{
var buttons = this.Query<Button>();
buttons.ForEach((button) => { button.SetChecked(button == toCheck); });
}
protected void SetButtonChecked(Button button, bool check)
{
if (button.IsChecked() != check)
{
if (check)
button.AddToClassList("Checked");
else
button.RemoveFromClassList("Checked");
button.SetChecked(check);
}
}
public void CollapseToolBar(bool collapse)
{
if (collapse)
AddToClassList("Collapse");
else
RemoveFromClassList("Collapse");
}
}
}