diff options
author | David Karlaš <david.karlas@xamarin.com> | 2014-11-25 17:15:16 +0300 |
---|---|---|
committer | David Karlaš <david.karlas@xamarin.com> | 2014-11-25 17:15:16 +0300 |
commit | ef7ecbd3a80bbdeb00ee53ed974b494faeb31ce4 (patch) | |
tree | 63cbb1a67d89b272bbeb2056c297a111acb949ca /main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers | |
parent | 6c1089034738400830e7385d81f2400f85ac0e95 (diff) |
[DebuggerVisualizers] Disabled preview on strings that are not ellipsized and improved PreviewWindow UI(padding, colors, font size..)
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers')
2 files changed, 19 insertions, 9 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs index 705e4d6655..ad0c2d609a 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs @@ -49,7 +49,7 @@ namespace MonoDevelop.Debugger.PreviewVisualizers if (label.SizeRequest ().Width > 500) { label.WidthRequest = 500; label.Wrap = true; - label.LineWrapMode = Pango.WrapMode.Word; + label.LineWrapMode = Pango.WrapMode.WordChar; } else { label.Justify = Gtk.Justification.Center; } @@ -57,7 +57,7 @@ namespace MonoDevelop.Debugger.PreviewVisualizers label.Justify = Gtk.Justification.Left; var line15 = label.Layout.GetLine (15); if (line15 != null) { - label.Text = value.Substring (0, line15.StartIndex).TrimEnd ('\r', '\n') + "\n..."; + label.Text = value.Substring (0, line15.StartIndex).TrimEnd ('\r', '\n') + "\n…"; } } label.Show (); diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs index 4b2b90786f..652946bc4e 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs @@ -44,6 +44,7 @@ namespace MonoDevelop.Debugger public void Show (ObjectValue val, Gtk.Widget invokingWidget, Rectangle previewButtonArea) { Theme.SetFlatColor (new Cairo.Color (245 / 256.0, 245 / 256.0, 245 / 256.0)); + Theme.Padding = 0; ShowArrow = true; var mainBox = new VBox (); var headerTable = new Table (1, 3, false); @@ -62,10 +63,15 @@ namespace MonoDevelop.Debugger headerTable.Attach (hb, 0, 1, 0, 1); var headerTitle = new Label (); - headerTitle.UseMarkup = true; - headerTitle.Markup = "<b>" + val.TypeName.Split ('.').LastOrDefault ().Replace ("<", "<").Replace (">", ">") + "</b>"; - - headerTable.Attach (headerTitle, 1, 2, 0, 1); + headerTitle.ModifyFg (StateType.Normal, new Color (64, 64, 64)); + var font = headerTitle.Style.FontDescription.Copy (); + font.Size = (int)(12 * Pango.Scale.PangoScale); + font.Weight = Pango.Weight.Bold; + headerTitle.ModifyFont (font); + headerTitle.Text = val.TypeName.Split ('.').LastOrDefault (); + var vbTitle = new VBox (); + vbTitle.PackStart (headerTitle, false, false, 3); + headerTable.Attach (vbTitle, 1, 2, 0, 1); if (DebuggingService.HasValueVisualizers (val)) { var openButton = new Button (); @@ -76,10 +82,10 @@ namespace MonoDevelop.Debugger DebuggingService.ShowValueVisualizer (val); }; var hbox = new HBox (); - hbox.PackEnd (openButton, false, false, 0); + hbox.PackEnd (openButton, false, false, 2); headerTable.Attach (hbox, 2, 3, 0, 1); } else { - headerTable.Attach (new Label (), 2, 3, 0, 1); + headerTable.Attach (new Label (), 2, 3, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 10, 0); } mainBox.PackStart (headerTable); mainBox.ShowAll (); @@ -96,7 +102,11 @@ namespace MonoDevelop.Debugger if (widget == null) { widget = new GenericPreviewVisualizer ().GetVisualizerWidget (val); } - mainBox.PackStart (widget); + var alignment = new Alignment (0, 0, 1, 1); + alignment.SetPadding (1, 3, 3, 3); + alignment.Show (); + alignment.Add (widget); + mainBox.PackStart (alignment); ContentBox.Add (mainBox); ShowPopup (invokingWidget, previewButtonArea, PopupPosition.Left); } |