Merge pull request #1452 from xylographe/xcomp

Fixed ShowTip method (Forms/Compare)
This commit is contained in:
Nikolaj Olsson 2015-12-17 17:17:00 +01:00
commit e5932f3289
2 changed files with 12 additions and 4 deletions

View File

@ -309,8 +309,8 @@ namespace Nikse.SubtitleEdit.Forms
this.Controls.Add(this.buttonOpenSubtitle2); this.Controls.Add(this.buttonOpenSubtitle2);
this.Controls.Add(this.buttonOpenSubtitle1); this.Controls.Add(this.buttonOpenSubtitle1);
this.Controls.Add(this.buttonOK); this.Controls.Add(this.buttonOK);
this.Controls.Add(this.labelSubtitle2);
this.Controls.Add(this.subtitleListView2); this.Controls.Add(this.subtitleListView2);
this.Controls.Add(this.labelSubtitle2);
this.Controls.Add(this.subtitleListView1); this.Controls.Add(this.subtitleListView1);
this.Controls.Add(this.labelSubtitle1); this.Controls.Add(this.labelSubtitle1);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

View File

@ -827,10 +827,18 @@ namespace Nikse.SubtitleEdit.Forms
private void ShowTip(Control control) private void ShowTip(Control control)
{ {
string sub1Path = control.Text; var text = control.Text;
if (!string.IsNullOrEmpty(sub1Path)) if (!string.IsNullOrEmpty(text))
{ {
toolTip1.Show(Path.GetFileName(sub1Path), control); try
{
text = Path.GetFileName(text);
}
catch
{
// not a path
}
toolTip1.Show(text, control);
} }
} }