mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Initial commit
This commit is contained in:
commit
3c7cc0c973
8391 changed files with 704313 additions and 0 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue