private void DrawElementCB(Rect totalRect, int index, bool isActive, bool isFocused)
        {
            float dividerSize = 1f;
            float paddingV    = 6f;
            float paddingH    = 4f;
            float labelWidth  = 80f;
            float iconSize    = 14f;

            bool isSelected = m_reorderableList.index == index;

            Color bgColor;

            if (EditorGUIUtility.isProSkin)
            {
                if (isSelected)
                {
                    ColorUtility.TryParseHtmlString("#424242", out bgColor);
                }
                else
                {
                    ColorUtility.TryParseHtmlString("#383838", out bgColor);
                }
            }
            else
            {
                if (isSelected)
                {
                    ColorUtility.TryParseHtmlString("#b4b4b4", out bgColor);
                }
                else
                {
                    ColorUtility.TryParseHtmlString("#c2c2c2", out bgColor);
                }
            }

            Color dividerColor;

            if (isSelected)
            {
                dividerColor = new Color(0, .8f, .8f, 1f);
            }
            else
            {
                if (EditorGUIUtility.isProSkin)
                {
                    ColorUtility.TryParseHtmlString("#202020", out dividerColor);
                }
                else
                {
                    ColorUtility.TryParseHtmlString("#a8a8a8", out dividerColor);
                }
            }

            Color prevColor = GUI.color;

            // modify total rect so it hides the builtin list UI
            totalRect.xMin -= 20f;
            totalRect.xMax += 4f;

            bool containsMouse = false;

            if (totalRect.Contains(Event.current.mousePosition))
            {
                containsMouse = true;
            }

            // modify currently selected element if mouse down in this elements GUI rect
            if (containsMouse && Event.current.type == EventType.MouseDown)
            {
                m_reorderableList.index = index;
            }

            // draw list element separator
            Rect separatorRect = totalRect;

            // separatorRect.height = dividerSize;
            GUI.color = dividerColor;
            GUI.DrawTexture(separatorRect, Texture2D.whiteTexture, ScaleMode.StretchToFill);
            GUI.color = prevColor;

            // Draw BG texture to hide ReorderableList highlight
            totalRect.yMin += dividerSize;
            totalRect.xMin += dividerSize;
            totalRect.xMax -= dividerSize;
            totalRect.yMax -= dividerSize;

            GUI.color = bgColor;
            GUI.DrawTexture(totalRect, Texture2D.whiteTexture, ScaleMode.StretchToFill, false);

            GUI.color = new Color(.7f, .7f, .7f, 1f);

            Filter filter = GetFilterAtIndex(index);

            if (filter == null)
            {
                return;
            }

            bool changed = false;

            Rect moveRect    = new Rect(totalRect.xMin + paddingH, totalRect.yMin + paddingV, iconSize, iconSize);
            Rect enabledRect = new Rect(moveRect.xMax + paddingH, moveRect.yMin, iconSize, iconSize);
            Rect elementRect = new Rect(enabledRect.xMax + paddingH,
                                        enabledRect.yMin,
                                        totalRect.xMax - (enabledRect.xMax + paddingH),
                                        totalRect.height - paddingV * 2);
            Rect dropdownRect = new Rect(enabledRect.xMax + paddingH, moveRect.yMin, labelWidth, EditorGUIUtility.singleLineHeight);
            Rect removeRect   = new Rect(elementRect.xMax - iconSize - paddingH, moveRect.yMin, iconSize, iconSize);

            // draw move handle rect
            if (containsMouse || isSelected)
            {
                EditorGUIUtility.AddCursorRect(moveRect, MouseCursor.Pan);
                GUI.DrawTexture(moveRect, Styles.move, ScaleMode.StretchToFill);
            }

            EditorGUI.BeginChangeCheck();
            {
                // show eye for toggling enabled state of the filter
                if (GUI.Button(enabledRect, Styles.GetEyeTexture(filter.enabled), GUIStyle.none))
                {
                    // m_filterStack.filters[index].enabled = !m_filterStack.filters[index].enabled;
                    Undo.RecordObject(filter, "Toggle Filter Enable");
                    filter.enabled = !filter.enabled;

                    if (EditorUtility.IsPersistent(m_filterStack))
                    {
                        EditorUtility.SetDirty(m_filterStack);
                        AssetDatabase.SaveAssets();
                    }
                }
            }
            changed |= EditorGUI.EndChangeCheck();

            // update dragging state
            if (containsMouse && isSelected)
            {
                if (Event.current.type == EventType.MouseDrag && !m_dragging && isFocused)
                {
                    m_dragging = true;
                    m_reorderableList.index = index;
                }
            }

            if (m_dragging)
            {
                if (Event.current.type == EventType.MouseUp)
                {
                    m_dragging = false;
                }
            }

            using (new EditorGUI.DisabledScope(!m_filterStack.filters[index].enabled || (m_dragging && m_reorderableList.index == index)))
            {
                int selected = GetFilterIndex(filter.GetDisplayName());

                if (selected < 0)
                {
                    selected = 0;
                    Debug.Log($"Could not find correct filter type for: {filter.GetDisplayName()}. Defaulting to first filter type");
                }

                EditorGUI.LabelField(dropdownRect, s_displayNames[selected]);

                if (!m_dragging)
                {
                    Rect filterRect = new Rect(dropdownRect.xMax + paddingH, dropdownRect.yMin, removeRect.xMin - dropdownRect.xMax - paddingH * 2, elementRect.height);

                    GUI.color = prevColor;
                    Undo.RecordObject(filter, "Filter Changed");

                    EditorGUI.BeginChangeCheck();

                    filter.DoGUI(filterRect);

                    changed |= EditorGUI.EndChangeCheck();
                }
            }

            if (changed)
            {
                m_serializedObject.ApplyModifiedProperties();
                m_serializedObject.Update();

                onChanged?.Invoke(m_serializedObject.targetObject as FilterStack);
            }

            GUI.color = prevColor;
        }