protected override void OnSelected() { info.Start(); BlameWidget widget = Control.GetNativeWidget <BlameWidget> (); widget.Reset(); var buffer = info.Document.GetContent <MonoDevelop.Ide.Editor.TextEditor> (); if (buffer != null) { var loc = buffer.CaretLocation; int line = loc.Line < 1 ? 1 : loc.Line; int column = loc.Column < 1 ? 1 : loc.Column; widget.Editor.SetCaretTo(line, column, highlight: false, centerCaret: false); } }
protected override void OnSelected() { info.Start(); BlameWidget blameWidget = Control.GetNativeWidget <BlameWidget> (); blameWidget.Reset(); var buffer = info.Document.GetContent <MonoDevelop.Ide.Editor.TextEditor> (); if (buffer != null) { if (!(buffer.TextView is MonoTextEditor)) { //compatibility for other not MonoTextEditor editors var loc = buffer.CaretLocation; int line = loc.Line < 1 ? 1 : loc.Line; int column = loc.Column < 1 ? 1 : loc.Column; blameWidget.Editor.SetCaretTo(line, column, highlight: false, centerCaret: false); } } }
protected override void OnSelected() { info.Start(); BlameWidget widget = Control.GetNativeWidget <BlameWidget> (); widget.Reset(); var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> (); if (sourceEditor != null) { widget.Editor.Caret.Location = sourceEditor.TextEditor.Caret.Location; widget.Editor.VAdjustment.Value = sourceEditor.TextEditor.VAdjustment.Value; } }
public Components.Window CreateTooltipWindow(Control parent) { //large amounts of text are expensive to lay out, and the preview window //doesn't need all that much anyway var txt = Text; if (txt.Length > 4096) { txt = txt.Substring(0, 4096) + "..."; } var w = parent.GetNativeWidget <Widget> ()?.GdkWindow; return(new CodePreviewWindow(w) { Text = Text }); }
public void RemoveOverlay (Control messageOverlayContent) { widget.RemoveOverlay (messageOverlayContent.GetNativeWidget<Widget> ()); }
public void AddOverlay (Control messageOverlayContent, Func<int> sizeFunc) { widget.AddOverlay (messageOverlayContent.GetNativeWidget<Widget> (), sizeFunc); }