public void LayoutDrawUnwind(Rect rect, EditorGUILayoutState state) { if (state.ShouldUseVisibility()) { if (Event.current.type == EventType.Repaint) { Rect new_visible_rect = GUIUtilityExtensions.GetVisibleRect(); if (new_visible_rect.height <= Screen.height && new_visible_rect.height >= 16.0f) { visible_rect = new_visible_rect; } } } else { visible_rect = rect; } if (rect.width > 16.0f) { int draw_id = next_draw_id++; element.Plan(rect.width, state); element.Layout(rect.min); element.Draw(draw_id, visible_rect); element.Unwind(draw_id); } }
public float Plan(float width, EditorGUILayoutState state) { float total_weight = elements.Convert(e => e.GetDimension().GetWeight()).Sum(); float total_minimum = elements.Convert(e => e.GetDimension().GetMinimum()).Sum(); height = elements.Convert(e => e.Plan(width, total_weight, total_minimum, state)).Max(); return(height); }
public override float ModifyFootprintHeight(float height, EditorGUILayoutState state) { if (HasLabel()) { return(height + label_height); } return(height); }
static public EditorGUILayoutState GetWithShouldAlwaysShowRecoveryFields(this EditorGUILayoutState item, bool should) { return(new EditorGUILayoutState( item.GetCurrentLabelWidth(), item.ShouldAutoSizeLabels(), item.GetAutoSizeLabelMargin(), item.ShouldUseVisibility(), should )); }
static public EditorGUILayoutState GetWithCurrentLabelWidth(this EditorGUILayoutState item, float width) { return(new EditorGUILayoutState( width, item.ShouldAutoSizeLabels(), item.GetAutoSizeLabelMargin(), item.ShouldUseVisibility(), item.ShouldAlwaysShowRecoveryFields() )); }
public float Plan(float width, EditorGUILayoutState state) { if (width != footprint_width || state != layout_state || is_plan_invalid) { footprint_width = width; layout_state = state; DoPlan(); } return(footprint_height); }
public EditorGUIElement() { is_plan_invalid = true; is_layout_invalid = true; layout_state = new EditorGUILayoutState(); attachments = new List <EditorGUIElementAttachment>(); surpressed_attachments = new List <EditorGUIElementAttachment>(); AddAttachment(new EditorGUIElementAttachment_Singular_Margin(1.0f)); }
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()); }
public override EditorGUIElementPlan PlanContentsInternal(EditorGUIElementPlan plan, EditorGUILayoutState state) { return(plan.Shrink(left, right, bottom, top)); }
public override EditorGUIElementPlan PlanElementInternal(EditorGUIElementPlan plan, EditorGUILayoutState state) { if (HasLabel()) { plan.SplitAtLeftOffset(state.GetCurrentLabelWidth(), out label_plan, out plan); } return(plan); }
public virtual float ModifyFootprintHeight(float height, EditorGUILayoutState state) { return(height); }
public float Plan(float width, EditorGUILayoutState state) { return(element.Plan(width, state)); }
public override EditorGUIElementPlan PlanContentsInternal(EditorGUIElementPlan plan, EditorGUILayoutState state) { plan.SplitAtLeftOffset(state.GetCurrentLabelWidth(), out index_plan, out plan); return(plan); }
public override EditorGUIElementPlan PlanElementInternal(EditorGUIElementPlan plan, EditorGUILayoutState state) { box_plan = plan; return(plan); }
public override float ModifyFootprintHeight(float height, EditorGUILayoutState state) { return(height + bottom + top); }
public override EditorGUIElementPlan PlanContentsInternal(EditorGUIElementPlan plan, EditorGUILayoutState state) { if (HasLabel()) { plan.SplitAtBottomOffset(label_height, out label_plan, out plan); } return(plan.Shrink(indent_width, 0.0f, 0.0f, 0.0f)); }
public float Plan(float total_width, float total_weight, float total_minimum, EditorGUILayoutState state) { return(Plan(dimension.Calculate(total_width, total_weight, total_minimum), state)); }
public virtual EditorGUIElementPlan PlanContentsInternal(EditorGUIElementPlan plan, EditorGUILayoutState state) { return(plan); }