Exemplo n.º 1
0
 private void AddStyleProperties()
 {
     StyleProperties = Rule.Style.GetUIComponents(Rule, this, Editor.StopScroll, Editor.StartScroll);
     if (StyleProperties.FirstOrDefault() is ColorPropertyPanel colorProperty)
     {
         colorProperty.OnValueChanged += (Color32 c) => Editor.RefreshItem();
     }
 }
Exemplo n.º 2
0
        private void AddStyleProperties()
        {
            StyleProperties = Rule.Style.GetUIComponents(Rule.Line, this);
            if (StyleProperties.OfType <ColorPropertyPanel>().FirstOrDefault() is ColorPropertyPanel colorProperty)
            {
                colorProperty.OnValueChanged += (Color32 c) => Editor.RefreshItem();
            }

            Editor.SetStopScroll(StyleProperties);
        }
Exemplo n.º 3
0
        private void OnSelectTemplate(StyleTemplate template)
        {
            if (template.Style.Copy() is LineStyle style)
            {
                Rule.Style           = style;
                Style.SelectedObject = Rule.Style.Type;

                Editor.RefreshItem();
                ClearStyleProperties();
                AddStyleProperties();
            }
        }
Exemplo n.º 4
0
        private void ApplyStyle(LineStyle style)
        {
            if ((Rule.Style.Type & Manager.Style.StyleType.GroupMask) != (style.Type & Manager.Style.StyleType.GroupMask))
            {
                return;
            }

            Rule.Style           = style.CopyLineStyle();
            Style.SelectedObject = Rule.Style.Type;

            Editor.RefreshItem();
            ClearStyleProperties();
            AddStyleProperties();
        }
Exemplo n.º 5
0
        private void StyleChanged(Style.StyleType style)
        {
            if (style == Rule.Style.Type)
            {
                return;
            }

            var newStyle = TemplateManager.GetDefault <LineStyle>(style);

            Rule.Style.CopyTo(newStyle);

            Rule.Style = newStyle;

            Editor.RefreshItem();
            ClearStyleProperties();
            AddStyleProperties();
        }