1.0.0: Fixed issue, where toolbar elements could overlap with other toolbar elements in Unity 2020 and older
This commit is contained in:
parent
0a2858f8ca
commit
bf2b2f1383
3 changed files with 43 additions and 11 deletions
|
|
@ -59,17 +59,18 @@ namespace Module.NavigationTool.Editor.Toolbar
|
|||
private static VisualElement CreateParent(VisualElement root, string query, bool isLeft)
|
||||
{
|
||||
VisualElement parent = root.Q(query);
|
||||
|
||||
var result = new VisualElement
|
||||
{
|
||||
style = {
|
||||
flexGrow = 1,
|
||||
flexDirection = FlexDirection.Row
|
||||
}
|
||||
};
|
||||
|
||||
VisualElement result;
|
||||
|
||||
if (isLeft)
|
||||
{
|
||||
result = new VisualElement
|
||||
{
|
||||
style = {
|
||||
flexGrow = 1,
|
||||
flexDirection = FlexDirection.Row
|
||||
}
|
||||
};
|
||||
|
||||
result.Add(new VisualElement
|
||||
{
|
||||
style = {
|
||||
|
|
@ -77,6 +78,24 @@ namespace Module.NavigationTool.Editor.Toolbar
|
|||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
result = new VisualElement
|
||||
{
|
||||
style = {
|
||||
flexGrow = 1,
|
||||
flexDirection = FlexDirection.RowReverse
|
||||
}
|
||||
};
|
||||
|
||||
result.Add(new VisualElement
|
||||
{
|
||||
style =
|
||||
{
|
||||
flexGrow = 1
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
parent.Add(result);
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue