diff options
author | Vaclav Vancura <vaclav@vancura.org> | 2015-01-05 18:50:36 +0300 |
---|---|---|
committer | Vaclav Vancura <vaclav@vancura.org> | 2015-01-05 18:50:36 +0300 |
commit | 36f8c2df7a94c3bb56221d4309807a458e0006f2 (patch) | |
tree | d672a3daa005c56c3b644b8f008ada588b9d3f29 /main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs | |
parent | 9d8a5824583d0c02a4c44d8ce1687dc1aceb3847 (diff) |
[DebuggerVisualizers] Appearance tweaks
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs | 19 |
1 files changed, 19 insertions, 0 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 ad0c2d609a..604979ad5e 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs @@ -26,6 +26,7 @@ using System; using MonoDevelop.Components; using Mono.Debugging.Client; +using Gtk; namespace MonoDevelop.Debugger.PreviewVisualizers { @@ -41,11 +42,26 @@ namespace MonoDevelop.Debugger.PreviewVisualizers public override Control GetVisualizerWidget (ObjectValue val) { string value = val.Value; + Gdk.Color col = new Gdk.Color (85, 85, 85); + if (!val.IsNull && (val.TypeName == "string" || val.TypeName == "char[]")) value = '"' + GetString (val) + '"'; if (DebuggingService.HasInlineVisualizer (val)) value = DebuggingService.GetInlineVisualizer (val).InlineVisualize (val); + var label = new Gtk.Label (value); + var font = label.Style.FontDescription.Copy (); + + if (font.SizeIsAbsolute) { + font.AbsoluteSize = font.Size - 1; + } else { + font.Size -= (int)(Pango.Scale.PangoScale); + } + + label.ModifyFont (font); + label.ModifyFg (StateType.Normal, col); + label.SetPadding (4, 4); + if (label.SizeRequest ().Width > 500) { label.WidthRequest = 500; label.Wrap = true; @@ -53,6 +69,7 @@ namespace MonoDevelop.Debugger.PreviewVisualizers } else { label.Justify = Gtk.Justification.Center; } + if (label.Layout.GetLine (1) != null) { label.Justify = Gtk.Justification.Left; var line15 = label.Layout.GetLine (15); @@ -60,7 +77,9 @@ namespace MonoDevelop.Debugger.PreviewVisualizers label.Text = value.Substring (0, line15.StartIndex).TrimEnd ('\r', '\n') + "\n…"; } } + label.Show (); + return label; } |