void SaveAndRepaint() { if (m_ControllerSettings != null) { m_ControllerSettings.Save(); } if (m_SelectedRecorderItem != null) { m_RecorderSettingPanel.Dirty(ChangeType.Layout | ChangeType.Styles); } Repaint(); }
void SetupModule(int newModuleIndex) { if (s_Instance == null) { return; } m_MainViewIMGUIElement.Clear(); if (m_RegisteredModules.Count > newModuleIndex) { m_CurrentModuleIndex = newModuleIndex; if (m_CurrentModule != null) { m_CurrentModule.OnModuleDeactivate(); } m_CurrentModule = null; m_CurrentModule = m_RegisteredModules[newModuleIndex]; m_CurrentModule.OnModuleActivate(); } if (m_MainViewElement != null) { m_MainViewElement.Dirty(ChangeType.Repaint); } if (m_MainViewIMGUIElement != null) { m_MainViewIMGUIElement.Dirty(ChangeType.Repaint); } }
private void UpdatePreviewLayout(VisualElement preview, Rect layout) { if (preview != null) { preview.layout = layout; preview.style.positionType = PositionType.Relative; preview.Dirty(ChangeType.Layout); } }
public void ClearInstructionHighlighter() { if (this.m_PaddingHighlighter != null && this.m_PaddingHighlighter.shadow.parent != null) { VisualElement parent = this.m_PaddingHighlighter.shadow.parent; this.m_PaddingHighlighter.RemoveFromHierarchy(); this.m_ContentHighlighter.RemoveFromHierarchy(); parent.Dirty(ChangeType.Repaint); } }
public void UpdatePortInputVisibilities() { foreach (var portInputView in m_PortInputContainer.OfType <PortInputView>()) { var slot = portInputView.slot; var oldVisibility = portInputView.visible; portInputView.visible = expanded && !node.owner.GetEdges(node.GetSlotReference(slot.id)).Any(); if (portInputView.visible != oldVisibility) { m_PortInputContainer.Dirty(ChangeType.Repaint); } } }
private void AddPreviewHelper(VisualElement preview, int index, bool animated) { // Update the current preview with the newly added preview m_CurrentPreview = preview; Insert(index, m_CurrentPreview); if (animated) { Rect startRect = new Rect(Vector2.zero, m_CurrentPreview.layout.size); Rect endRect = startRect; startRect.height = 0f; m_AddAnimation.from = startRect; m_AddAnimation.to = endRect; m_AddAnimation.duration = animationDuration; m_AddAnimation.Start(); } else { m_CurrentPreview.style.positionType = PositionType.Relative; m_CurrentPreview.Dirty(ChangeType.Layout); } }
public static void MarkDirtyRepaint(this VisualElement element) { element.Dirty(ChangeType.Repaint); }
internal static void SetDirty(VisualElement element) { #if !UNITY_2018_3_OR_NEWER element.Dirty(ChangeType.Layout | ChangeType.Styles); #endif }