static public EditorGUILayoutState GetWithCurrentLabelWidth(this EditorGUILayoutState item, float width) { return(new EditorGUILayoutState( width, item.ShouldAutoSizeLabels(), item.GetAutoSizeLabelMargin(), item.ShouldUseVisibility(), item.ShouldAlwaysShowRecoveryFields() )); }
static public EditorGUILayoutState GetWithShouldAlwaysShowRecoveryFields(this EditorGUILayoutState item, bool should) { return(new EditorGUILayoutState( item.GetCurrentLabelWidth(), item.ShouldAutoSizeLabels(), item.GetAutoSizeLabelMargin(), item.ShouldUseVisibility(), should )); }
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()); }