mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 15:02:35 +01:00
Allow resizing 'Text' Column instead 'Gap to next in seconds'
This commit is contained in:
parent
3e2c5f4136
commit
cd966162db
@ -1108,5 +1108,12 @@ namespace Nikse.SubtitleEdit.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetCustomResize(EventHandler handler)
|
||||||
|
{
|
||||||
|
if (handler == null)
|
||||||
|
return;
|
||||||
|
Resize -= SubtitleListViewResize;
|
||||||
|
Resize += handler;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,6 +19,9 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Utilities.FixLargeFonts(this, buttonOK);
|
Utilities.FixLargeFonts(this, buttonOK);
|
||||||
|
|
||||||
|
// Remove SE's built-in ListView resize logic
|
||||||
|
SubtitleListview1.SetCustomResize(SubtitleListView1_Resize);
|
||||||
|
|
||||||
Text = Configuration.Settings.Language.DurationsBridgeGaps.Title;
|
Text = Configuration.Settings.Language.DurationsBridgeGaps.Title;
|
||||||
buttonOK.Text = Configuration.Settings.Language.General.Ok;
|
buttonOK.Text = Configuration.Settings.Language.General.Ok;
|
||||||
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
|
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
|
||||||
@ -193,5 +196,19 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
GeneratePreview();
|
GeneratePreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SubtitleListView1_Resize(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Store last column with 'cause it won't be changed
|
||||||
|
var columnsCount = SubtitleListview1.Columns.Count - 1;
|
||||||
|
var lastColumnWidth = SubtitleListview1.Columns[columnsCount].Width;
|
||||||
|
var width = 0;
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
width += SubtitleListview1.Columns[i].Width;
|
||||||
|
}
|
||||||
|
SubtitleListview1.Columns[4].Width = SubtitleListview1.Width - (width + lastColumnWidth);
|
||||||
|
SubtitleListview1.Columns[columnsCount].Width = lastColumnWidth;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user