Example #1
0
 static public EditorGUILayoutState GetWithCurrentLabelWidth(this EditorGUILayoutState item, float width)
 {
     return(new EditorGUILayoutState(
                width,
                item.ShouldAutoSizeLabels(),
                item.GetAutoSizeLabelMargin(),
                item.ShouldUseVisibility(),
                item.ShouldAlwaysShowRecoveryFields()
                ));
 }
Example #2
0
 static public EditorGUILayoutState GetWithShouldAlwaysShowRecoveryFields(this EditorGUILayoutState item, bool should)
 {
     return(new EditorGUILayoutState(
                item.GetCurrentLabelWidth(),
                item.ShouldAutoSizeLabels(),
                item.GetAutoSizeLabelMargin(),
                item.ShouldUseVisibility(),
                should
                ));
 }
Example #3
0
        protected override float DoPlanInternal()
        {
            EditorGUILayoutState state = GetLayoutState();

            if (state.ShouldAutoSizeLabels())
            {
                state = state.GetWithCurrentLabelWidth(
                    GetChildren()
                    .Convert(c => c.GetAttachments <EditorGUIElementAttachment_Singular_Label_GUIContent_Inline>())
                    .Flatten()
                    .Convert(a => a.GetLabel().GetLabelLayoutWidth())
                    .Max() + state.GetAutoSizeLabelMargin()
                    );
            }

            return(GetChildren().Convert(e => e.Plan(GetContentsWidth(), state)).Sum());
        }