mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Set max height for text box
Sometimes after a resize, the text box becomes way too heigh.
This commit is contained in:
parent
c261b30bc0
commit
fca88ffbde
File diff suppressed because it is too large
Load Diff
@ -20620,6 +20620,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void Main_Shown(object sender, EventArgs e)
|
||||
{
|
||||
splitContainerListViewAndText.SplitterMoved += splitContainerListViewAndText_SplitterMoved;
|
||||
splitContainerListViewAndText.SizeChanged += splitContainerListViewAndText_SizeChanged;
|
||||
|
||||
imageListBookmarks.Images.Add(pictureBoxBookmark.Image);
|
||||
SetListViewStateImages();
|
||||
|
||||
@ -28762,5 +28765,24 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
aSSStylesToolStripMenuItem.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void splitContainerListViewAndText_SplitterMoved(object sender, SplitterEventArgs e)
|
||||
{
|
||||
if (Configuration.Settings.General.SubtitleTextBoxMaxHeight < splitContainerListViewAndText.Panel2MinSize &&
|
||||
Configuration.Settings.General.SubtitleTextBoxMaxHeight > 1000)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (splitContainerListViewAndText.Panel2.Height > Configuration.Settings.General.SubtitleTextBoxMaxHeight)
|
||||
{
|
||||
splitContainerListViewAndText.SplitterDistance = splitContainerListViewAndText.Height - Configuration.Settings.General.SubtitleTextBoxMaxHeight;
|
||||
}
|
||||
}
|
||||
|
||||
private void splitContainerListViewAndText_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
splitContainerListViewAndText_SplitterMoved(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user