Example #1
0
        protected override void OnFocused()
        {
            info.Start();
            if (ComparisonWidget.originalComboBox.Text == GettextCatalog.GetString("Local"))
            {
                ComparisonWidget.UpdateLocalText();
            }
            var textView = info.Controller.GetContent <ITextView> ();

            if (textView != null)
            {
                var(line, column) = textView.Caret.Position.BufferPosition.GetLineAndColumn1Based();
                ComparisonWidget.OriginalEditor.SetCaretTo(line, column);
            }

            if (ComparisonWidget.Allocation.Height == 1 && ComparisonWidget.Allocation.Width == 1)
            {
                ComparisonWidget.SizeAllocated += HandleComparisonWidgetSizeAllocated;
            }
            else
            {
                HandleComparisonWidgetSizeAllocated(null, new Gtk.SizeAllocatedArgs());
            }

            widget.UpdatePatchView();
        }
Example #2
0
        protected override void OnSelected()
        {
            info.Start();
            ComparisonWidget.UpdateLocalText();
            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;
                ComparisonWidget.OriginalEditor.SetCaretTo(line, column);
            }

            if (ComparisonWidget.Allocation.Height == 1 && ComparisonWidget.Allocation.Width == 1)
            {
                ComparisonWidget.SizeAllocated += HandleComparisonWidgetSizeAllocated;
            }
            else
            {
                HandleComparisonWidgetSizeAllocated(null, new Gtk.SizeAllocatedArgs());
            }

            widget.UpdatePatchView();
        }
Example #3
0
        public void Selected()
        {
            info.Start();
            ComparisonWidget.UpdateLocalText();
            var buffer = info.Document.GetContent <ITextBuffer> ();

            if (buffer != null)
            {
                int line, col;
                buffer.GetLineColumnFromPosition(buffer.CursorPosition, out line, out col);
                ComparisonWidget.OriginalEditor.SetCaretTo(line, col);
            }

            if (ComparisonWidget.Allocation.Height == 1 && ComparisonWidget.Allocation.Width == 1)
            {
                ComparisonWidget.SizeAllocated += HandleComparisonWidgetSizeAllocated;
            }
            else
            {
                HandleComparisonWidgetSizeAllocated(null, new Gtk.SizeAllocatedArgs());
            }

            widget.UpdatePatchView();
        }