internal void SetSharedStyles(VisualElementStylesData sharedStyle) { Debug.Assert(sharedStyle.isShared); if (sharedStyle == m_SharedStyle) { return; } if (hasInlineStyle) { m_Style.Apply(sharedStyle, StylePropertyApplyMode.CopyIfNotInline); } else { m_Style = sharedStyle; } m_SharedStyle = sharedStyle; if (onStylesResolved != null) { onStylesResolved(m_Style); } OnStyleResolved(m_Style); // This is a pre-emptive since we do not know if style changes actually cause a repaint or a layout // But thouse should be the only possible type of changes needed IncrementVersion(VersionChangeType.Styles | VersionChangeType.Layout | VersionChangeType.Repaint); }
internal void SetSharedStyles(VisualElementStylesData sharedStyle) { Debug.Assert(sharedStyle.isShared); ClearDirty(ChangeType.StylesPath | ChangeType.Styles); if (sharedStyle == m_SharedStyle) { return; } if (hasInlineStyle) { m_Style.Apply(sharedStyle, StylePropertyApplyMode.CopyIfNotInline); } else { m_Style = sharedStyle; } m_SharedStyle = sharedStyle; if (onStylesResolved != null) { onStylesResolved(m_Style); } OnStyleResolved(m_Style); Dirty(ChangeType.Repaint); }
public InlineStyleAccess(VisualElement ve) { this.ve = ve; if (ve.specifiedStyle.isShared) { var inline = new VisualElementStylesData(false); inline.Apply(ve.m_SharedStyle, StylePropertyApplyMode.Copy); ve.m_Style = inline; } }
// for internal use only, used by asset instantiation to push local styles // likely can be replaced by merging VisualContainer and VisualElement // and then storing the inline sheet in the list held by VisualContainer internal void SetInlineStyles(VisualElementStylesData inlineStyle) { Debug.Assert(!inlineStyle.isShared); inlineStyle.Apply(m_Style, StylePropertyApplyMode.CopyIfEqualOrGreaterSpecificity); m_Style = inlineStyle; }