Пример #1
0
 IEnumerator <object> ManageFocusTask()
 {
     while (true)
     {
         if (PropertyLabel.IsFocused())
         {
             editor.SetFocus();
         }
         flatFillPresenter.Color = editor.IsFocused() ? Theme.Colors.SelectedBackground : Theme.Colors.GrayBackground;
         yield return(null);
     }
 }
Пример #2
0
        IEnumerator <object> ManageLabelTask()
        {
            while (true)
            {
                var popupMenu = PropertyLabel.Input.WasMouseReleased(1);
                if (popupMenu || PropertyLabel.Input.WasMouseReleased(0))
                {
                    PropertyLabel.SetFocus();
                }
                PropertyLabel.Color = PropertyLabel.IsFocused() ? Theme.Colors.KeyboardFocusBorder : Theme.Colors.BlackText;
                if (popupMenu)
                {
                    // Wait until the label actually change its color.
                    yield return(null);

                    yield return(null);

                    ShowPropertyContextMenu();
                }
                if (PropertyLabel.IsFocused())
                {
                    if (Command.Copy.WasIssued())
                    {
                        Command.Copy.Consume();
                        Copy();
                    }
                    if (Command.Paste.WasIssued())
                    {
                        Command.Paste.Consume();
                        Paste();
                    }
                    if (resetToDefault.WasIssued())
                    {
                        resetToDefault.Consume();
                        var defaultValue = EditorParams.DefaultValueGetter();
                        if (defaultValue != null)
                        {
                            SetProperty(defaultValue);
                        }
                    }
                }
                yield return(null);
            }
        }