Пример #1
0
        public void OnGUI(Rect rect, Colors.NoteColorCollection colors)
        {
            if (!_isEnabledFunc())
            {
                GUI.enabled = false;
            }

            DrawNoteBackground(rect, colors.main);

            GUILayout.BeginArea(GetTextAreaRect(rect));
            EditorGUILayout.BeginVertical();
            GUI.skin = Assets.Styles.Skin;

            _scroll = EditorGUILayout.BeginScrollView(_scroll);
            EditorGUI.BeginChangeCheck();
            Assets.Styles.TextArea.fontSize = StickiesEditorSettings.FontSize;
            Assets.Styles.TextArea.richText = true;
            _text = EditorGUILayout.TextArea(_text, Assets.Styles.TextArea);
            if (EditorGUI.EndChangeCheck())
            {
                _onTextUpdated(_text);
            }
            EditorGUILayout.EndScrollView();

            GUI.skin = null;

            EditorGUILayout.EndVertical();
            GUILayout.EndArea();

            GUI.enabled = true;
        }
Пример #2
0
        public void OnGUI(Rect rect, Colors.NoteColorCollection colors)
        {
            var headerRect = GetHeaderRect(rect);

            StickiesGUI.ColorRect(headerRect, colors.header, Color.clear);

            DrawDeleteButton(headerRect);
            DrawColorPickerButton(headerRect);
        }
        public void OnGUI(Rect rect, Colors.NoteColorCollection colors)
        {
            var colorPickerRect = new Rect(rect.x, rect.y, rect.width, ColorPickerHeaderHeight);

            StickiesGUI.ColorRect(colorPickerRect, colors.header, Color.clear);

            var newColor = ColorChooser(colorPickerRect);

            if (newColor != NoteColor.None)
            {
                _onColorSelected(newColor);
            }
        }