OdinMenuStyle

The style settings used by OdinMenuItem.

A nice trick to style your menu is to add the tree.DefaultMenuStyle to the tree itself, and style it live. Once you are happy, you can hit the Copy CSharp Snippet button, remove the style from the menu tree, and paste the style directly into your code.

namespace Sirenix.OdinInspector.Editor
{
public class OdinMenuStyle
}

Requirements

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector
Version: 1.0.6.1

See Also

Static Properties

Return Type Definition Description
OdinMenuStyle TreeViewStyle Creates and returns an instance of a menu style that makes it look like Unity's project window.

Fields

Return Type Definition Description
bool AlignTriangleLeft Whether or not to align the triangle left or right of the content. If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level.
float BorderAlpha The border alpha.
float BorderPadding The horizontal border padding.
bool Borders Whether to draw borders between menu items.
bool DrawFoldoutTriangle Whether to draw the a foldout triangle for menu items with children.
int Height The height of the menu item.
float IconOffset The size of the icon.
float IconPadding The padding between the icon and other content.
float IconSize The size of the icon.
float IndentAmount The number of pixels to indent per level indent level.
float NotSelectedIconAlpha The transparency of icons when the menu item is not selected.
float Offset The global offset of the menu item content
Color SelectedColorDarkSkin The background color for when a menu item is selected.
Color SelectedColorLightSkin The background color for when a menu item is selected.
float TrianglePadding The padding between the foldout triangle icon and other content.
float TriangleSize The size of the foldout triangle icon.

Methods

Return Type Definition Description
OdinMenuStyle SetAlignTriangleLeft(bool) Sets whether or not to align the triangle left or right of the content. If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level.
OdinMenuStyle SetBorderAlpha(float) Sets the border alpha.
OdinMenuStyle SetBorderPadding(float) Sets the border alpha.
OdinMenuStyle SetBorders(bool) Sets whether to draw borders between menu items.
OdinMenuStyle SetDrawFoldoutTriangle(bool) Sets whether to draw the a foldout triangle for menu items with children.
OdinMenuStyle SetHeight(int) Sets the height of the menu item.
OdinMenuStyle SetIconOffset(float) Sets the size of the icon.
OdinMenuStyle SetIconPadding(float) Sets the padding between the icon and other content.
OdinMenuStyle SetIconSize(float) Sets the size of the icon.
OdinMenuStyle SetIndentAmount(float) Sets the number of pixels to indent per level indent level.
OdinMenuStyle SetNotSelectedIconAlpha(float) Sets the transparency of icons when the menu item is not selected.
OdinMenuStyle SetOffset(float) Sets the global offset of the menu item content
OdinMenuStyle SetSelectedColorDarkSkin(Color) Sets the background color for when a menu item is selected.
OdinMenuStyle SetSelectedColorLightSkin(Color) Sets the background color for when a menu item is selected.
OdinMenuStyle SetTrianglePadding(float) Sets the padding between the foldout triangle icon and other content.
OdinMenuStyle SetTriangleSize(float) Sets the size of the foldout triangle icon.