Fix index column's width when opening a file

This commit is contained in:
OmrSi 2021-12-20 02:30:49 +02:00
parent 1b48c9bde1
commit 756a42a30b

View File

@ -12260,7 +12260,9 @@ namespace Nikse.SubtitleEdit.Forms
{
if (SubtitleListview1.ColumnIndexNumber >= 0)
{
Configuration.Settings.General.ListViewNumberWidth = SubtitleListview1.Columns[SubtitleListview1.ColumnIndexNumber].Width;
var fileHasBookmarkedLines = _subtitle != null && _subtitle.Paragraphs.Any(p => p.Bookmark != null);
var columnIndexNumberWidth = SubtitleListview1.Columns[SubtitleListview1.ColumnIndexNumber].Width;
Configuration.Settings.General.ListViewNumberWidth = fileHasBookmarkedLines ? columnIndexNumberWidth - 18 : columnIndexNumberWidth;
}
if (SubtitleListview1.ColumnIndexStart >= 0)
@ -23032,6 +23034,10 @@ namespace Nikse.SubtitleEdit.Forms
imageListBookmarks.Images.Add(pictureBoxBookmark.Image);
SetListViewStateImages();
if (_subtitle != null && _subtitle.Paragraphs.Any(p => p.Bookmark != null))
{
SubtitleListview1.Columns[SubtitleListview1.ColumnIndexNumber].Width = SubtitleListview1.Columns[SubtitleListview1.ColumnIndexNumber].Width + 18;
}
toolStripButtonToggleVideo.Checked = !Configuration.Settings.General.ShowVideoPlayer;
toolStripButtonToggleVideo_Click(null, null);