Пример #1
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
            });
        }
Пример #2
0
 public KeyFunctionButtonBinding(IPropertyEditorParams editorParams, KeyFunctionButton button)
 {
     this.editorParams = editorParams;
     this.button       = button;
 }