File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Assets/Editor Toolbox/Editor/Internal Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ private void ValidateElementsRects(int arraySize)
5555 }
5656 }
5757
58- private void DrawEmptyList ( Rect middleRect )
58+ private void DrawEmptyList ( Rect middleRect , bool showEmptyLabel )
5959 {
6060 using ( var emptyListGroup = new EditorGUILayout . VerticalScope ( Style . contentGroupStyle ) )
6161 {
@@ -65,9 +65,12 @@ private void DrawEmptyList(Rect middleRect)
6565 }
6666 else
6767 {
68- var height = EditorGUIUtility . singleLineHeight ;
69- var rect = EditorGUILayout . GetControlRect ( GUILayout . Height ( height ) ) ;
70- EditorGUI . LabelField ( rect , Style . emptyOrInvalidListContent ) ;
68+ var height = Style . minEmptyHeight ;
69+ EditorGUILayout . GetControlRect ( GUILayout . Height ( height ) ) ;
70+ if ( showEmptyLabel )
71+ {
72+ EditorGUILayout . LabelField ( Style . emptyOrInvalidListContent ) ;
73+ }
7174 }
7275 }
7376 }
@@ -233,9 +236,15 @@ protected override void DoListMiddle(Rect middleRect)
233236 //make sure rects array is valid
234237 ValidateElementsRects ( arraySize ) ;
235238 //handle empty or invalid array
236- if ( ! IsPropertyValid || ! IsExpanded || IsEmpty )
239+ if ( ! IsPropertyValid || ! IsExpanded )
240+ {
241+ DrawEmptyList ( middleRect , false ) ;
242+ return ;
243+ }
244+
245+ if ( IsEmpty )
237246 {
238- DrawEmptyList ( middleRect ) ;
247+ DrawEmptyList ( middleRect , true ) ;
239248 return ;
240249 }
241250
You can’t perform that action at this time.
0 commit comments