示例#1
0
        public BlameWidget(VersionControlDocumentInfo info)
        {
            this.info = info;

            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            editor = new TextEditor(info.Document.TextEditorData.Document, info.Document.TextEditorData.Options);
            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.ExposeEvent          += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
        }
示例#2
0
        public BlameWidget(VersionControlDocumentInfo info)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.info = info;
            var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();

            vAdjustment = new Adjustment(
                sourceEditor.TextEditor.VAdjustment.Value,
                sourceEditor.TextEditor.VAdjustment.Lower,
                sourceEditor.TextEditor.VAdjustment.Upper,
                sourceEditor.TextEditor.VAdjustment.StepIncrement,
                sourceEditor.TextEditor.VAdjustment.PageIncrement,
                sourceEditor.TextEditor.VAdjustment.PageSize);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment = new Adjustment(
                sourceEditor.TextEditor.HAdjustment.Value,
                sourceEditor.TextEditor.HAdjustment.Lower,
                sourceEditor.TextEditor.HAdjustment.Upper,
                sourceEditor.TextEditor.HAdjustment.StepIncrement,
                sourceEditor.TextEditor.HAdjustment.PageIncrement,
                sourceEditor.TextEditor.HAdjustment.PageSize);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            var doc = new TextDocument(sourceEditor.TextEditor.Document.Text)
            {
                IsReadOnly = true,
                MimeType   = sourceEditor.TextEditor.Document.MimeType,
            };

            editor = new MonoTextEditor(doc, sourceEditor.TextEditor.Options);
            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.Painted              += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
            editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
            editor.FocusInEvent          += ComparisonWidget.EditorFocusIn;
            editor.Document.Folded       += delegate {
                QueueDraw();
            };
            editor.Document.FoldTreeUpdated += delegate {
                QueueDraw();
            };
            editor.DoPopupMenu = ShowPopup;
            Show();
        }
示例#3
0
            public AuthorSectionAccessible(BlameRenderer widget, int line, Annotation ann, double y1, double y2)
            {
                if (widget is null)
                {
                    throw new ArgumentNullException(nameof(widget));
                }
                if (ann is null)
                {
                    throw new ArgumentNullException(nameof(ann));
                }

                Accessible           = AccessibilityElementProxy.ButtonElementProxy();
                Accessible.GtkParent = widget;

                Accessible.SetRole(AtkCocoa.Roles.AXMenuButton);
                Accessible.Title = GettextCatalog.GetString("Authors Overview");

                string msg = widget.GetCommitMessage(line, false);

                Accessible.Label         = GettextCatalog.GetString("Author {0} Date {1} Revision {2} Message {3}", ann.Author, ann.Date, widget.TruncRevision(ann.Text), msg);
                Accessible.PerformPress += Accessible_PerformPress;
                int y = (int)y1;
                int h = (int)(y2 - y1);

                Accessible.FrameInGtkParent = new Rectangle(0, y, widget.Allocation.Width, h);
                var cocoaY = widget.Allocation.Height - y - h;

                Accessible.FrameInParent = new Rectangle(0, cocoaY, widget.Allocation.Width, h);
                this.widget     = widget;
                this.annotation = ann;
                this.y          = (int)y2;
            }
示例#4
0
        public BlameWidget(VersionControlDocumentInfo info)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.info = info;
            var textView = info.Controller.GetContent <ITextView> ();

            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            var doc = new TextDocument(textView.TextSnapshot.GetText())
            {
                IsReadOnly = true,
                MimeType   = IdeServices.DesktopService.GetMimeTypeForContentType(textView.TextBuffer.ContentType)
            };
            var options = new CustomEditorOptions(DefaultSourceEditorOptions.Instance);

            options.TabsToSpaces = false;

            editor = new MonoTextEditor(doc, new SourceEditor.StyledSourceEditorOptions(options));

            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.Painted              += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
            editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
            editor.FocusInEvent          += ComparisonWidget.EditorFocusIn;
            editor.Document.Folded       += delegate {
                QueueDraw();
            };
            editor.Document.FoldTreeUpdated += delegate {
                QueueDraw();
            };
            editor.DoPopupMenu = ShowPopup;
            Show();
        }
示例#5
0
        public BlameWidget(VersionControlDocumentInfo info)
        {
            this.info = info;
            var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();

            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            hScrollBar = new HScrollbar(hAdjustment);
            AddChild(hScrollBar);

            editor = new TextEditor(sourceEditor.TextEditor.Document, sourceEditor.TextEditor.Options);
            AddChild(editor);
            editor.SetScrollAdjustments(hAdjustment, vAdjustment);

            overview = new BlameRenderer(this);
            AddChild(overview);

            this.DoubleBuffered          = true;
            editor.Painted              += HandleEditorExposeEvent;
            editor.EditorOptionsChanged += delegate {
                overview.OptionsChanged();
            };
            editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
            editor.FocusInEvent          += ComparisonWidget.EditorFocusIn;
            editor.Document.Folded       += delegate {
                QueueDraw();
            };
            editor.Document.FoldTreeUpdated += delegate {
                QueueDraw();
            };
            editor.ButtonPressEvent += OnPopupMenu;
            Show();
        }
示例#6
0
		public BlameWidget (VersionControlDocumentInfo info)
		{
			this.info = info;
			
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			
			vScrollBar = new VScrollbar (vAdjustment);
			AddChild (vScrollBar);
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;
			
			hScrollBar = new HScrollbar (hAdjustment);
			AddChild (hScrollBar);
			
			editor = new TextEditor (info.Document.Editor.Document, info.Document.Editor.Options);
			AddChild (editor);
			editor.SetScrollAdjustments (hAdjustment, vAdjustment);
			
			overview = new BlameRenderer (this);
			AddChild (overview);
			
			this.DoubleBuffered = true;
			editor.Painted += HandleEditorExposeEvent;
			editor.EditorOptionsChanged += delegate {
				overview.OptionsChanged ();
			};
			editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
			editor.FocusInEvent += ComparisonWidget.EditorFocusIn;
			editor.Document.Folded += delegate {
				QueueDraw ();
			};
			editor.Document.FoldTreeUpdated += delegate {
				QueueDraw ();
			};
			editor.ButtonPressEvent += OnPopupMenu;
			Show ();
		}
示例#7
0
		public BlameWidget (VersionControlDocumentInfo info)
		{
			GtkWorkarounds.FixContainerLeak (this);
			
			this.info = info;
			var sourceEditor = info.Document.GetContent<MonoDevelop.SourceEditor.SourceEditorView> ();
			
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			
			vScrollBar = new VScrollbar (vAdjustment);
			AddChild (vScrollBar);
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;

			hScrollBar = new HScrollbar (hAdjustment);
			AddChild (hScrollBar);
			
			editor = new TextEditor (sourceEditor.TextEditor.Document, sourceEditor.TextEditor.Options);
			AddChild (editor);
			editor.SetScrollAdjustments (hAdjustment, vAdjustment);
			
			overview = new BlameRenderer (this);
			AddChild (overview);
			
			this.DoubleBuffered = true;
			editor.Painted += HandleEditorExposeEvent;
			editor.EditorOptionsChanged += delegate {
				overview.OptionsChanged ();
			};
			editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
			editor.FocusInEvent += ComparisonWidget.EditorFocusIn;
			editor.Document.Folded += delegate {
				QueueDraw ();
			};
			editor.Document.FoldTreeUpdated += delegate {
				QueueDraw ();
			};
			editor.DoPopupMenu = ShowPopup;
			Show ();
		}
示例#8
0
		public BlameWidget (VersionControlDocumentInfo info)
		{
			this.info = info;
			
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			
			vScrollBar = new VScrollbar (vAdjustment);
			AddChild (vScrollBar);
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;
			
			hScrollBar = new HScrollbar (hAdjustment);
			AddChild (hScrollBar);
			
			editor = new TextEditor (info.Document.TextEditorData.Document, info.Document.TextEditorData.Options);
			AddChild (editor);
			editor.SetScrollAdjustments (hAdjustment, vAdjustment);
			
			overview = new BlameRenderer (this);
			AddChild (overview);
			
			this.DoubleBuffered = true;
			editor.ExposeEvent += HandleEditorExposeEvent;
			editor.EditorOptionsChanged += delegate {
				overview.OptionsChanged ();
			};
		}