[mono/monodevelop] 67aba427: Fixed 'Bug 15146 - Inline error & warning ellipsis bubble gaps '

Mike Krüger ([email protected]) <[email protected]>
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <00000141918681e1-e7bb4575-dbe3-4e4e-9dae-6e75621a9935-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/monodevelop
  Compare: https://github.com/mono/monodevelop/compare/b453e031dba9...67aba4279f25

   Commit: 67aba4279f258210f5fb496033075b138537c367
   Author: Mike Krüger <[email protected]> (mkrueger)
     Date: 2013-10-07 06:04:49 GMT
      URL: https://github.com/mono/monodevelop/commit/67aba4279f258210f5fb496033075b138537c367

Fixed 'Bug 15146 - Inline error & warning ellipsis bubble gaps '

Changed paths:
  M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs

Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
===================================================================
@@ -379,18 +379,21 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
 			bool hideText = false;
 			bubbleIsReduced = customLayout;
 			var showErrorCount = errorCounterWidth > 0 && errorCountLayout != null;
+			double roundingRadius = editor.LineHeight / 2 - 1;
+
 			if (customLayout) {
 				width = editor.Allocation.Width - sx;
 				string text = layouts[0].Layout.Text;
 				drawLayout = new Pango.Layout (editor.PangoContext);
 				drawLayout.FontDescription = cache.fontDescription;
 				var paintWidth = (width - errorCounterWidth - editor.LineHeight + 4);
-				var minWidth = Math.Max (17, errorCounterWidth) + editor.LineHeight;
+				var minWidth = Math.Max (25, errorCounterWidth) * editor.Options.Zoom;
 				if (paintWidth < minWidth) {
 					hideText = true;
-					drawLayout.SetMarkup ("<span weight='heavy'>···</span>");
-					width = minWidth;
 					showErrorCount = false;
+//					drawLayout.SetMarkup ("<span weight='heavy'>···</span>");
+					width = minWidth;
+					roundingRadius = 10 * editor.Options.Zoom;
 					sx = Math.Min (sx, editor.Allocation.Width - width);
 				} else {
 					drawLayout.Ellipsize = Pango.EllipsizeMode.End;
@@ -406,7 +409,7 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
 			bubbleWidth = width;
 
 			var bubbleHeight = editor.LineHeight - 1;
-			g.RoundedRectangle (sx, y + 1, width, bubbleHeight, editor.LineHeight / 2 - 1);
+			g.RoundedRectangle (sx, y + 1, width, bubbleHeight, roundingRadius);
 			g.SetSourceColor (TagColor.Color);
 			g.Fill ();
 
@@ -455,8 +458,26 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
 				g.Restore ();
 			}
 
-			// Draw label text
-			if (!showErrorCount || !hideText) {
+			if (hideText) {
+				// Draw dots
+				double radius = 2 * editor.Options.Zoom;
+				double spacing = 1 * editor.Options.Zoom;
+				double shadowOffset = 1 * editor.Options.Zoom;
+
+				sx += 1 * editor.Options.Zoom + Math.Ceiling((bubbleWidth - 3 * (radius * 2) - 2 * spacing) / 2);
+				for (int i = 0; i < 3; i++) {
+					g.Arc (sx, y + 1 + bubbleHeight / 2 + shadowOffset, radius, 0, Math.PI * 2);
+					g.SetSourceColor (MessageBubbleCache.ShadowColor);
+					g.Fill ();
+
+					g.Arc (sx, y + 1 + bubbleHeight / 2, radius, 0, Math.PI * 2);
+					g.SetSourceColor (TagColor.SecondColor);
+					g.Fill ();
+					sx += radius * 2 + spacing;
+				}
+
+			} else {
+				// Draw label text
 				g.Save ();
 				g.Translate (sx + editor.LineHeight / 2, y + (editor.LineHeight - layouts [0].Height) / 2 + 1);
 
_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.