Example #1
0
        public SelectionView(Terminal terminal, SelectionService selection, CGRect rect, CellDimension cellDimensions) : base(rect)
        {
            if (terminal == null)
            {
                throw new ArgumentNullException(nameof(terminal));
            }
            if (selection == null)
            {
                throw new ArgumentNullException(nameof(selection));
            }
            if (rect == null)
            {
                throw new ArgumentNullException(nameof(rect));
            }

            this.terminal       = terminal;
            this.selection      = selection;
            this.cellDimensions = cellDimensions;

            selection.SelectionChanged += HandleSelectionChanged;

            WantsLayer = true;
            maskLayer  = new CAShapeLayer();
            Layer.Mask = maskLayer;

            SelectionColor = NSColor.FromColor(NSColor.Blue.ColorSpace, 0.4f, 0.2f, 0.9f, 0.8f);
        }
Example #2
0
        public CaretView(CellDimension dimensions) : base(new CGRect(0, 0, dimensions.Height, dimensions.Width + 2))
        {
            this.dimensions = dimensions;
            pos             = new Point(0, 0);
            padding         = 1;
            WantsLayer      = true;
            CaretColor      = NSColor.FromColor(NSColor.Blue.ColorSpace, 0.4f, 0.2f, 0.9f, 0.5f);

            maskLayer  = new CAShapeLayer();
            Layer.Mask = maskLayer;
            Focused    = false;
        }