Exemple #1
0
        private static void DecoratePropertyEditor(IPropertyEditor editor, int row)
        {
            var index = 0;

            if (editor.EditorParams.IsAnimable)
            {
                var keyColor       = KeyframePalette.Colors[editor.EditorParams.TangerineAttribute.ColorIndex];
                var keyframeButton = new KeyframeButton {
                    LayoutCell = new LayoutCell(Alignment.LeftCenter, stretchX: 0),
                    KeyColor   = keyColor,
                };
                keyframeButton.Clicked += editor.PropertyLabel.SetFocus;
                editor.LabelContainer.Nodes.Insert(index++, keyframeButton);
                editor.ContainerWidget.Tasks.Add(new KeyframeButtonBinding(editor.EditorParams, keyframeButton));
            }
            editor.ContainerWidget.Padding = new Thickness {
                Left = 4, Top = 3, Right = 12, Bottom = 4
            };
            editor.ContainerWidget.CompoundPresenter.Add(new WidgetFlatFillPresenter(
                                                             row % 2 == 0 ?
                                                             ColorTheme.Current.Inspector.StripeBackground1 :
                                                             ColorTheme.Current.Inspector.StripeBackground2
                                                             )
            {
                IgnorePadding = true
            });
            editor.ContainerWidget.Components.Add(new DocumentationComponent(editor.EditorParams.PropertyInfo.DeclaringType.Name + "." + editor.EditorParams.PropertyName));
        }
Exemple #2
0
        private void DecoratePropertyEditor(IPropertyEditor editor, int row)
        {
            var ctr = editor.ContainerWidget;

            if (!(editor is IExpandablePropertyEditor))
            {
                ctr.Nodes.Insert(0, new HSpacer(20));
            }

            var index = ctr.Nodes.Count() - 1;

            if (PropertyAttributes <TangerineStaticPropertyAttribute> .Get(editor.EditorParams.PropertyInfo) == null)
            {
                var keyFunctionButton = new KeyFunctionButton {
                    LayoutCell = new LayoutCell(Alignment.LeftCenter, stretchX: 0),
                };
                var keyframeButton = new KeyframeButton {
                    LayoutCell = new LayoutCell(Alignment.LeftCenter, stretchX: 0),
                    KeyColor   = KeyframePalette.Colors[editor.EditorParams.TangerineAttribute.ColorIndex],
                };
                keyFunctionButton.Clicked += editor.SetFocus;
                keyframeButton.Clicked    += editor.SetFocus;
                ctr.Nodes.Insert(index++, keyFunctionButton);
                ctr.Nodes.Insert(index++, keyframeButton);
                ctr.Nodes.Insert(index, new HSpacer(4));
                ctr.Tasks.Add(new KeyframeButtonBinding(editor.EditorParams, keyframeButton));
                ctr.Tasks.Add(new KeyFunctionButtonBinding(editor.EditorParams, keyFunctionButton));
            }
            else
            {
                ctr.Nodes.Insert(2, new HSpacer(42));
            }
            editor.ContainerWidget.Padding = new Thickness {
                Left = 4, Top = 1, Right = 12, Bottom = 1
            };
            editor.ContainerWidget.CompoundPresenter.Add(new WidgetFlatFillPresenter(
                                                             row % 2 == 0 ?
                                                             ColorTheme.Current.Inspector.StripeBackground1 :
                                                             ColorTheme.Current.Inspector.StripeBackground2
                                                             )
            {
                IgnorePadding = true
            });
        }
Exemple #3
0
 public KeyframeButtonBinding(IPropertyEditorParams editorParams, KeyframeButton button)
 {
     this.editorParams = editorParams;
     this.button       = button;
 }