示例#1
0
        public void StartHover(MessageBubbleTextMarker marker, double bubbleX, double bubbleY, double bubbleWidth, bool isReduced)
        {
            CancelHoverTimeout();
            if (removedMarker == marker)
            {
                CurrentSelectedTextMarker = marker;
                return;
            }

            hoverTimeout = GLib.Timeout.Add(200, delegate {
                CurrentSelectedTextMarker = marker;
                editor.QueueDraw();

                DestroyPopoverWindow();

                if (marker.Layouts == null || marker.Layouts.Count < 2 && !isReduced)
                {
                    return(false);
                }
                popoverWindow = new MessageBubblePopoverWindow(this, marker);
                popoverWindow.ShowWindowShadow = true;
                popoverWindow.ShowPopup(editor, new Gdk.Rectangle((int)(bubbleX + editor.TextViewMargin.XOffset), (int)bubbleY, (int)bubbleWidth, (int)editor.LineHeight), PopupPosition.Top);
                return(false);
            });
        }
			public MessageBubblePopoverWindow (MessageBubbleCache cache, MessageBubbleTextMarker marker)
			{
				this.cache = cache;
				this.marker = marker;
				ShowArrow = true;
				Opacity = 0.9;
			}
 public MessageBubblePopoverWindow(MessageBubbleCache cache, MessageBubbleTextMarker marker)
 {
     this.cache  = cache;
     this.marker = marker;
     ShowArrow   = true;
     Opacity     = 0.9;
 }
示例#4
0
 public MessageBubblePopoverWindow(MessageBubbleCache cache, MessageBubbleTextMarker marker)
 {
     this.cache        = cache;
     this.marker       = marker;
     ShowArrow         = true;
     Theme.ArrowLength = 7;
     TransientFor      = IdeApp.Workbench.RootWindow;
 }
        public MessageBubbleHighlightPopupWindow(SourceEditorView view, MessageBubbleTextMarker marker)
            : base(view.TextEditor)
        {
            this.marker = marker;

            ExpandWidth  = 36;
            ExpandHeight = 2;
            BounceEasing = Easing.Sine;
            Duration     = 600;
        }
//		new Gdk.Rectangle bounds;
		
		public MessageBubbleHighlightPopupWindow (SourceEditorView view, MessageBubbleTextMarker marker)
			: base (view.TextEditor)
		{
			this.marker = marker;
			
			ExpandWidth = 36;
			ExpandHeight = 2;
			BounceEasing = Easing.Sine;
			Duration = 150;
		}
示例#7
0
 void HandleBeginHover(object sender, EventArgs e)
 {
     CancelHoverTimeout();
     removedMarker = CurrentSelectedTextMarker;
     if (CurrentSelectedTextMarker == null)
     {
         return;
     }
     CurrentSelectedTextMarker = null;
     editor.QueueDraw();
 }
示例#8
0
 void HandleLeaveNotifyEvent(object o, Gtk.LeaveNotifyEventArgs args)
 {
     DestroyPopoverWindow();
     CancelHoverTimeout();
     if (CurrentSelectedTextMarker == null)
     {
         return;
     }
     CurrentSelectedTextMarker = null;
     editor.QueueDraw();
 }
示例#9
0
        void HandleLeaveNotifyEvent(object o, Gtk.LeaveNotifyEventArgs args)
        {
            CancelLeaveDestroyTimeout();
            leaveDestroyTimeout = GLib.Timeout.Add(100, delegate {
                DestroyPopoverWindow();
                leaveDestroyTimeout = 0;
                return(false);
            });

            CancelHoverTimeout();
            if (CurrentSelectedTextMarker == null)
            {
                return;
            }
            CurrentSelectedTextMarker = null;
            editor.QueueDraw();
        }
示例#10
0
		void UpdateTasks (object sender, TaskEventArgs e)
		{
			Task[] tasks = TaskService.Errors.GetFileTasks (ContentName);
			if (tasks == null)
				return;
			DisposeErrorMarkers (); // disposes messageBubbleCache as well.
			if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.Never)
				return;
			using (var undo = Document.OpenUndoGroup ()) {
				if (messageBubbleCache != null)
					messageBubbleCache.Dispose ();
				messageBubbleCache = new MessageBubbleCache (widget.TextEditor);
				
				foreach (Task task in tasks) {
					if (task.Severity == TaskSeverity.Error || task.Severity == TaskSeverity.Warning) {
						if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.ForErrors && task.Severity == TaskSeverity.Warning)
							continue;
						DocumentLine lineSegment = widget.Document.GetLine (task.Line);
						if (lineSegment == null)
							continue;
						var marker = currentErrorMarkers.FirstOrDefault (m => m.LineSegment == lineSegment);
						if (marker != null) {
							marker.AddError (task.Severity == TaskSeverity.Error, task.Description);
							continue;
						}
						MessageBubbleTextMarker errorTextMarker = new MessageBubbleTextMarker (messageBubbleCache, task, lineSegment, task.Severity == TaskSeverity.Error, task.Description);
						currentErrorMarkers.Add (errorTextMarker);
						
						errorTextMarker.IsVisible =  !IdeApp.Preferences.DefaultHideMessageBubbles;
						widget.Document.AddMarker (lineSegment, errorTextMarker, false);
					}
				}
			}
			widget.TextEditor.QueueDraw ();
		}
		void UpdateTasks (object sender, TaskEventArgs e)
		{
			Task[] tasks = TaskService.Errors.GetFileTasks (ContentName);
			if (tasks == null)
				return;
			DisposeErrorMarkers ();
			if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.Never)
				return;
			widget.Document.BeginAtomicUndo ();
			
			foreach (Task task in tasks) {
				if (task.Severity == TaskSeverity.Error || task.Severity == TaskSeverity.Warning) {
					if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.ForErrors && task.Severity == TaskSeverity.Warning)
						continue;
					LineSegment lineSegment = widget.Document.GetLine (task.Line - 1);
					if (lineSegment == null)
						continue;
					var marker = currentErrorMarkers.FirstOrDefault (m => m.LineSegment == lineSegment);
					if (marker != null) {
						marker.AddError (task.Severity == TaskSeverity.Error, task.Description);
						continue;
					}
					MessageBubbleTextMarker errorTextMarker = new MessageBubbleTextMarker (widget.TextEditor, task, lineSegment, task.Severity == TaskSeverity.Error, task.Description);
					currentErrorMarkers.Add (errorTextMarker);
					
					errorTextMarker.IsExpanded = !IdeApp.Preferences.DefaultHideMessageBubbles;
					widget.Document.AddMarker (lineSegment, errorTextMarker, false);
				}
			}
			widget.Document.EndAtomicUndo ();
			widget.TextEditor.QueueDraw ();
		}
示例#12
0
		void HandleLeaveNotifyEvent (object o, Gtk.LeaveNotifyEventArgs args)
		{
			DestroyPopoverWindow ();
			CancelHoverTimeout ();
			if (CurrentSelectedTextMarker == null)
				return;
			CurrentSelectedTextMarker = null;
			editor.QueueDraw ();
		}
示例#13
0
		void HandleBeginHover (object sender, EventArgs e)
		{
			CancelHoverTimeout ();
			removedMarker = CurrentSelectedTextMarker;
			if (CurrentSelectedTextMarker == null)
				return;
			CurrentSelectedTextMarker = null;
			editor.QueueDraw ();
		}
示例#14
0
		public void StartHover (MessageBubbleTextMarker marker, double bubbleX, double bubbleY, double bubbleWidth, bool isReduced)
		{
			CancelHoverTimeout ();
			if (removedMarker == marker) {
				CurrentSelectedTextMarker = marker;
				return;
			}

			hoverTimeout = GLib.Timeout.Add (200, delegate {
				CurrentSelectedTextMarker = marker;
				editor.QueueDraw ();

				DestroyPopoverWindow ();

				if (marker.Layouts.Count < 2 && !isReduced)
					return false;
				popoverWindow = new MessageBubblePopoverWindow (this, marker);
				popoverWindow.ShowPopup (editor, new Gdk.Rectangle ((int)(bubbleX + editor.TextViewMargin.XOffset), (int)bubbleY, (int)bubbleWidth, (int)editor.LineHeight) ,PopupPosition.Top);
				return false;
			});
		}
		void UpdateTasks (object sender, TaskEventArgs e)
		{
			TaskListEntry [] tasks = TaskService.Errors.GetFileTasks (ContentName);
			if (tasks == null)
				return;
			DisposeErrorMarkers (); // disposes messageBubbleCache as well.
			if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.Never)
				return;
			messageBubbleCache = new MessageBubbleCache (widget.TextEditor);
			CancelMessageBubbleUpdate ();
			var token = messageBubbleUpdateSource;

			Task.Run (delegate {
				var errorMarkers = new List<MessageBubbleTextMarker> ();
				foreach (TaskListEntry task in tasks) {
					if (token.IsCancellationRequested)
						return null;
					if (task.Severity == TaskSeverity.Error || task.Severity == TaskSeverity.Warning) {
						if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.ForErrors && task.Severity == TaskSeverity.Warning)
							continue;
						var errorTextMarker = new MessageBubbleTextMarker (messageBubbleCache, task, task.Severity == TaskSeverity.Error, task.Description);
						errorMarkers.Add (errorTextMarker);

						errorTextMarker.IsVisible = !IdeApp.Preferences.DefaultHideMessageBubbles;
					}
				}
				return errorMarkers;
			}).ContinueWith (t => {
				if (token.IsCancellationRequested)
					return;
				Application.Invoke (delegate {
					if (token.IsCancellationRequested)
						return;
					var newErrorMarkers = new List<MessageBubbleTextMarker> ();
					foreach (var marker in t.Result) {
						if (token.IsCancellationRequested)
							return;
						var lineSegment = widget.Document.GetLine (marker.Task.Line);
						if (lineSegment == null)
							continue;
						var oldMarker = lineSegment.Markers.OfType<MessageBubbleTextMarker> ().FirstOrDefault ();
						if (oldMarker != null) {
							oldMarker.AddError (marker.Task, marker.Task.Severity == TaskSeverity.Error, marker.Task.Description);
						} else {
							marker.LineSegment = lineSegment;
							widget.Document.AddMarker (lineSegment, marker, false);
							newErrorMarkers.Add (marker);
						}
					}
					this.currentErrorMarkers = newErrorMarkers;
				});
			});
		}
示例#16
0
		void HandleLeaveNotifyEvent (object o, Gtk.LeaveNotifyEventArgs args)
		{
			CancelLeaveDestroyTimeout ();
			leaveDestroyTimeout = GLib.Timeout.Add (100, delegate {
				DestroyPopoverWindow ();
				leaveDestroyTimeout = 0;
				return false;
			}); 

			CancelHoverTimeout ();
			if (CurrentSelectedTextMarker == null)
				return;
			CurrentSelectedTextMarker = null;
			editor.QueueDraw ();
		}
示例#17
0
			public MessageBubblePopoverWindow (MessageBubbleCache cache, MessageBubbleTextMarker marker)
			{
				this.cache = cache;
				this.marker = marker;
				ShowArrow = true;
				Theme.ArrowLength = 7;
				TransientFor = IdeApp.Workbench.RootWindow;
			}