void BlameFile_MouseMove(object sender, MouseEventArgs e) { if (_blame == null) { return; } int line = BlameFile.GetLineFromVisualPosY(e.Y); if (line >= _blame.Lines.Count) { return; } GitBlameHeader blameHeader = _blame.FindHeaderForCommitGuid(_blame.Lines[line].CommitGuid); if (blameHeader != lastBlameHeader) { BlameCommitter.ClearHighlighting(); BlameFile.ClearHighlighting(); for (int i = 0; i < _blame.Lines.Count; i++) { if (_blame.Lines[i].CommitGuid == blameHeader.CommitGuid) { BlameCommitter.HighlightLine(i, Color.FromArgb(225, 225, 225)); BlameFile.HighlightLine(i, Color.FromArgb(225, 225, 225)); } } BlameCommitter.Refresh(); BlameFile.Refresh(); lastBlameHeader = blameHeader; } }
void BlameFile_MouseMove(object sender, MouseEventArgs e) { if (_blame == null) { return; } int line = BlameFile.GetLineFromVisualPosY(e.Y); if (line >= _blame.Lines.Count) { return; } GitBlameHeader blameHeader = _blame.FindHeaderForCommitGuid(_blame.Lines[line].CommitGuid); string tooltipText = blameHeader.ToString(); if (lastTooltip != tooltipText) { BlameCommitter.ClearHighlighting(); BlameFile.ClearHighlighting(); for (int i = 0; i < _blame.Lines.Count; i++) { if (_blame.Lines[i].CommitGuid == blameHeader.CommitGuid) { BlameCommitter.HighlightLine(i, Color.FromArgb(225, 225, 225)); BlameFile.HighlightLine(i, Color.FromArgb(225, 225, 225)); } } BlameCommitter.Refresh(); BlameFile.Refresh(); } int newTooltipX = e.X + splitContainer2.SplitterDistance + 20; int newTooltipY = e.Y + splitContainer1.SplitterDistance + 20; if (lastTooltip != tooltipText || Math.Abs(lastTooltipX - newTooltipX) > 5 || Math.Abs(lastTooltipY - newTooltipY) > 5) { lastTooltip = tooltipText; lastTooltipX = newTooltipX; lastTooltipY = newTooltipY; //blameTooltip.Show(tooltipText, this, newTooltipX, newTooltipY); } }