protected new void OnCustomStyleResolved(CustomStyleResolvedEvent e) { if (e.customStyle.TryGetValue(s_DistanceProperty, out var dist)) { m_Distance = dist; } }
void OnCustomStyleResolved(CustomStyleResolvedEvent e) { var elementCustomStyle = e.customStyle; if (elementCustomStyle.TryGetValue(s_SpacingProperty, out var spacingValue)) { Spacing = spacingValue; } if (elementCustomStyle.TryGetValue(s_ThickLinesProperty, out var thicklinesValue)) { m_ThickLines = thicklinesValue; } if (elementCustomStyle.TryGetValue(s_ThickLineColorProperty, out var thicklineColorValue)) { m_ThickLineColor = thicklineColorValue; } if (elementCustomStyle.TryGetValue(s_LineColorProperty, out var lineColorValue)) { m_LineColor = lineColorValue; } if (elementCustomStyle.TryGetValue(s_GridBackgroundColorProperty, out var gridColorValue)) { m_GridBackgroundColor = gridColorValue; } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent evt) { ICustomStyle styles = evt.customStyle; if (styles.TryGetValue(_background_image_property, out Texture2D value)) { // if there is no background image create it if (_backgroundImage == null) { _backgroundImage = TiledImage.CreateBackground(value); _backgroundImage.AddToClassList("viewport-background"); hierarchy.Add(_backgroundImage); _backgroundImage.SendToBack(); _backgroundImage.StretchToParentSize(); _contentContainer.RegisterCallback <GeometryChangedEvent>(e => UpdateBackground()); } else { _backgroundImage.SetTexture(value); } UpdateBackground(); } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { float spacingValue = 0f; int thicklinesValue = 0; Color thicklineColorValue = Color.clear; Color lineColorValue = Color.clear; Color gridColorValue = Color.clear; ICustomStyle customStyle = e.customStyle; if (customStyle.TryGetValue(s_SpacingProperty, out spacingValue)) { m_Spacing = spacingValue; } if (customStyle.TryGetValue(s_ThickLinesProperty, out thicklinesValue)) { m_ThickLines = thickLines; } if (customStyle.TryGetValue(s_ThickLineColorProperty, out thicklineColorValue)) { m_ThickLineColor = thicklineColorValue; } if (customStyle.TryGetValue(s_LineColorProperty, out lineColorValue)) { m_LineColor = lineColorValue; } if (customStyle.TryGetValue(s_GridBackgroundColorProperty, out gridColorValue)) { m_GridBackgroundColor = gridColorValue; } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { var customStyle = e.customStyle; customStyle.TryGetValue(s_StartColorProperty, out m_StartColor); customStyle.TryGetValue(s_EndColorProperty, out m_EndColor); }
void OnCustomStyleResolved(CustomStyleResolvedEvent evt) { // TODO: Not the proper way; should use style property --unity-image-tint-color instead; // however, since portColor is variable, we cannot use until there is proper support for variables if (PortIcon is Image portIconImage) { portIconImage.tintColor = portColor; } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { int dist = 0; if (!m_DistanceIsInline && e.customStyle.TryGetValue(s_DistanceProperty, out dist)) { m_Distance = dist; } }
private void OnStyleResolved(CustomStyleResolvedEvent evt) { var root = evt.currentTarget as VisualElement; foreach (var pageEntry in root.Query <PageEntry>().Build().ToList()) { float left = pageEntry.depth * 12; pageEntry.style.paddingLeft = new StyleLength(new Length(left, LengthUnit.Pixel)); } }
void OnCustomStyleResolved(CustomStyleResolvedEvent e) { Color portColorValue = Color.clear; ICustomStyle customStyle = e.customStyle; if (customStyle.TryGetValue(m_PortColorProperty, out portColorValue)) { PortColor = portColorValue; } }
void OnCustomStyleResolved(CustomStyleResolvedEvent evt) { if (evt.customStyle.TryGetValue(s_LabelWidthRatioProperty, out var labelWidthRatio)) { m_LabelWidthRatio = labelWidthRatio; } if (evt.customStyle.TryGetValue(s_LabelExtraPaddingProperty, out var labelExtraPadding)) { m_LabelExtraPadding = labelExtraPadding; } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent evt) { if (Data == null) { return; } if (evt.customStyle.TryGetValue(s_SegmentColorProperty, out var color)) { Data.Color = color; MarkDirtyRepaint(); } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { Color colorValue; if (e.customStyle.TryGetValue(k_EdgeColorProperty, out colorValue)) { _edgeColor = colorValue; } _edgeControl.UpdateLayout(); _edgeControl.inputColor = edgeColor; _edgeControl.outputColor = edgeColor; }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { var customStyle = e.customStyle; customStyle.TryGetValue(s_BitImage, out m_BitImage); customStyle.TryGetValue(s_BitBkgndImage, out m_BitBkgndImage); for (int i = 0; i < m_Background.childCount - 1; ++i) { m_Background.ElementAt(i).style.backgroundImage = m_BitBkgndImage; } ValueToGUI(true); }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { Color oldColor = m_CurveColor; Color colorValue = Color.clear; if (e.customStyle.TryGetValue(s_CurveColorProperty, out colorValue)) { m_CurveColor = colorValue; } if (m_CurveColor != oldColor && renderMode == RenderMode.Texture) { // The mesh texture is updated at each repaint, the standard texture should however be regenerated m_TextureDirty = true; } }
void OnCustomStyleResolved(CustomStyleResolvedEvent evt) { if (evt.customStyle.TryGetValue(k_ItemHeight, out var newItemHeight)) { m_ItemHeight = newItemHeight; } if (evt.customStyle.TryGetValue(k_ItemInterPadding, out var newItemInterPadding)) { m_ItemInterPadding = newItemInterPadding; } if (evt.customStyle.TryGetValue(k_ItemHeight, out var newDigitWidth)) { m_DigitWidth = newDigitWidth; } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { Color inputValue; Color outputValue; ICustomStyle styles = e.customStyle; if (styles.TryGetValue(k_InputColorProperty, out inputValue)) { m_InputColor = inputValue; } if (styles.TryGetValue(k_OutputColorProperty, out outputValue)) { m_OutputColor = outputValue; } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { Color selectionValue = Color.clear; Color cursorValue = Color.clear; ICustomStyle customStyle = e.customStyle; if (customStyle.TryGetValue(s_SelectionColorProperty, out selectionValue)) { m_SelectionColor = selectionValue; } if (customStyle.TryGetValue(s_CursorColorProperty, out cursorValue)) { m_CursorColor = cursorValue; } SyncGUIStyle(this, editorEngine.style); }
void OnCustomStyleResolved(CustomStyleResolvedEvent e) { if (e.customStyle.TryGetValue(k_CellSizeProperty, out var cellSizeProperty)) { m_CellSize = cellSizeProperty; } if (e.customStyle.TryGetValue(k_OddCellColorProperty, out var oddCellColor)) { m_OddCellColor = oddCellColor; } if (e.customStyle.TryGetValue(k_EvenCellColorProperty, out var evenCellColor)) { m_EvenCellColor = evenCellColor; } GenerateResources(); }
void OnCustomStyleResolved(CustomStyleResolvedEvent e) { ICustomStyle styles = e.customStyle; Color segmentColorValue; Color deleteColorValue; if (styles.TryGetValue(s_SegmentSizeProperty, out var segmentSizeValue)) { m_SegmentSize = segmentSizeValue; } if (styles.TryGetValue(s_SegmentColorProperty, out segmentColorValue)) { m_SegmentColor = segmentColorValue; } if (styles.TryGetValue(s_DeleteSegmentColorProperty, out deleteColorValue)) { m_DeleteSegmentColor = deleteColorValue; } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { ICustomStyle styles = e.customStyle; float segmentSizeValue = 0f; Color segmentColorValue = Color.clear; Color deleteColorValue = Color.clear; if (styles.TryGetValue(s_SegmentSizeProperty, out segmentSizeValue)) { m_SegmentSize = segmentSizeValue; } if (styles.TryGetValue(s_SegmentColorProperty, out segmentColorValue)) { m_SegmentColor = segmentColorValue; } if (styles.TryGetValue(s_DeleteSegmentColorProperty, out deleteColorValue)) { m_DeleteSegmentColor = deleteColorValue; } }
private void OnCustomStyleResolved(CustomStyleResolvedEvent e) { OnCustomStyleResolved(e.customStyle); }
void OnCustomStyleResolved(CustomStyleResolvedEvent e) { RegenerateTexture(); }
void OnCustomStyleResolved(CustomStyleResolvedEvent evt) { schedule.Execute(a => UpdateSeparators()); }