private int?DrawSceneItem(int itemIndex, DragAndDropInfo dragState, SceneAsset item,
                                  EventType currentEventType,
                                  int?indexToRemove)
        {
            using (new GUIColorScope(
                       itemIndex == dragState.SourceItemIndex
                    ? new Color(GUI.color.r, GUI.color.g, GUI.color.b, 0.25f)
                    : GUI.color))
            {
                var rowRect = Rect.zero;
                var content = EditorGUIUtility.ObjectContent(item, typeof(SceneAsset));

                // Reserve space for the handle, draw it later.
                var grabberRect = GUILayoutUtility.GetRect(new GUIContent(content.image),
                                                           EditorStyles.helpBox,
                                                           GUILayout.MinWidth(16), GUILayout.MinHeight(16));

                grabberRect.min = new Vector2(grabberRect.min.x, grabberRect.min.y + 4);
                grabberRect.max = new Vector2(grabberRect.max.x, grabberRect.max.y + 4);

                BuildConfigEditorStyle.DrawGrabber(grabberRect);

                using (new EditorGUIUtility.IconSizeScope(new Vector2(24, 24)))
                {
                    GUILayout.Label(content);
                }

                if (currentEventType == EventType.Repaint)
                {
                    rowRect = BuildConfigEditorStyle.RectUnion(grabberRect, GUILayoutUtility.GetLastRect());
                }

                GUILayout.FlexibleSpace();
                using (new EditorGUIUtility.IconSizeScope(SmallIconSize))
                {
                    if (GUILayout.Button(style.RemoveSceneButtonContents, EditorStyles.miniButton))
                    {
                        indexToRemove = itemIndex;
                    }
                }

                if (currentEventType == EventType.Repaint)
                {
                    rowRect = BuildConfigEditorStyle.RectUnion(rowRect, GUILayoutUtility.GetLastRect());
                    dragState.AllItemsRect = BuildConfigEditorStyle.RectUnion(dragState.AllItemsRect, rowRect);
                    dragState.ItemHeight   = rowRect.height;
                }
            }

            return(indexToRemove);
        }