@@ -72,7 +72,8 @@ public override VisualElement CreateInspectorGUI()
72
72
//Prepare metallic toggles for material mode
73
73
for ( int i = 0 ; i < 12 ; i ++ )
74
74
{
75
- Toggle metallicToggle = new Toggle ( ) { name = "metallic" + i , label = "is Metallic" , tabIndex = i } ;
75
+ Toggle metallicToggle = new Toggle ( ) { name = "metallic" + i , label = "Metallic" , tabIndex = i } ;
76
+ metallicToggle . Q < Label > ( ) . style . minWidth = 60 ;
76
77
metallicToggle . bindingPath = "isMetalBools.Array.data[" + i + "]" ;
77
78
metallicToggle . style . display = UnityEngine . UIElements . DisplayStyle . None ; //hidden in UI until used
78
79
root . Add ( metallicToggle ) ;
@@ -94,6 +95,7 @@ public override VisualElement CreateInspectorGUI()
94
95
self . UpdateMaterial ( ) ;
95
96
} ;
96
97
98
+
97
99
onChange ( self , root ) ; // Initialize
98
100
return root ;
99
101
}
@@ -127,12 +129,19 @@ void CreateColorFields(ColorCheckerTool target, VisualElement root, Color32[] co
127
129
//Creates the Rows Containers
128
130
for ( int i = 0 ; i < rows ; i ++ )
129
131
{
130
- VisualElement newRow = new VisualElement ( ) { name = "colorfieldsRow" + i } ;
131
- newRow . style . flexDirection = UnityEngine . UIElements . FlexDirection . Row ;
132
- newRow . style . alignItems = UnityEngine . UIElements . Align . FlexStart ;
133
- newRow . style . justifyContent = UnityEngine . UIElements . Justify . SpaceAround ;
134
- newRow . style . alignSelf = UnityEngine . UIElements . Align . Stretch ;
135
- newRow . style . maxHeight = 22 ;
132
+ VisualElement newRow = new ( )
133
+ {
134
+ name = "colorfieldsRow" + i ,
135
+ style =
136
+ {
137
+ flexDirection = UnityEngine . UIElements . FlexDirection . Row ,
138
+ alignItems = UnityEngine . UIElements . Align . FlexStart ,
139
+ justifyContent = UnityEngine . UIElements . Justify . SpaceAround ,
140
+ alignSelf = UnityEngine . UIElements . Align . Stretch ,
141
+ maxHeight = 22 ,
142
+ flexWrap = Wrap . Wrap
143
+ }
144
+ } ;
136
145
colorfieldsRoot . Add ( newRow ) ;
137
146
}
138
147
0 commit comments