Example #1
0
            protected override bool OnMotionNotifyEvent(EventMotion evnt)
            {
                TooltipText = null;
                if (dragPosition >= 0)
                {
                    int x, y;
                    widget.GetPointer(out x, out y);
                    int newWidthRequest = widget.Allocation.Width - x;
                    newWidthRequest = Math.Min(widget.Allocation.Width - (int)widget.Editor.TextViewMargin.XOffset, Math.Max(leftSpacer, newWidthRequest));

                    WidthRequest = newWidthRequest;
                    QueueResize();
                }
                int startLine = widget.Editor.YToLine(widget.Editor.VAdjustment.Value + evnt.Y);
                var ann       = startLine > 0 && startLine <= annotations.Count ? annotations[startLine - 1] : null;

                if (ann != null)
                {
                    TooltipText = GetCommitMessage(startLine, true);
                }

                highlightPositon = evnt.Y;
                if (highlightAnnotation != ann)
                {
                    highlightAnnotation = ann;
                    widget.QueueDraw();
                }

                return(base.OnMotionNotifyEvent(evnt));
            }
Example #2
0
            protected override bool OnMotionNotifyEvent(EventMotion evnt)
            {
                TooltipText = null;
                if (dragPosition >= 0)
                {
                    int x, y;
                    widget.GetPointer(out x, out y);
                    int newWidthRequest = widget.Allocation.Width - x;
                    newWidthRequest = Math.Min(widget.Allocation.Width - (int)widget.Editor.TextViewMargin.XOffset, Math.Max(leftSpacer, newWidthRequest));

                    WidthRequest = newWidthRequest;
                    QueueResize();
                }

                GetAnnotationFromY(evnt.Y, out var annotation, out var startLine);

                if (annotation != null)
                {
                    TooltipText = GetCommitMessage(startLine - 1, true);
                }

                SetHighlight(annotation, startLine, evnt.Y, highlightAnnotation != annotation);

                return(base.OnMotionNotifyEvent(evnt));
            }