Remember undocked video player fullscreen - thx Ingo :)

This commit is contained in:
Nikolaj Olsson 2019-03-08 16:12:30 +01:00
parent 60fe6a152b
commit 3b429109be
2 changed files with 17 additions and 4 deletions

View File

@ -703,6 +703,7 @@ $HorzAlign = Center
public bool PromptDeleteLines { get; set; }
public bool Undocked { get; set; }
public string UndockedVideoPosition { get; set; }
public bool UndockedVideoFullscreen { get; set; }
public string UndockedWaveformPosition { get; set; }
public string UndockedVideoControlsPosition { get; set; }
public bool WaveformCenter { get; set; }
@ -2082,6 +2083,12 @@ $HorzAlign = Center
settings.General.UndockedVideoPosition = subNode.InnerText;
}
subNode = node.SelectSingleNode("UndockedVideoFullscreen");
if (subNode != null)
{
settings.General.UndockedVideoFullscreen = Convert.ToBoolean(subNode.InnerText);
}
subNode = node.SelectSingleNode("UndockedWaveformPosition");
if (subNode != null)
{
@ -5699,6 +5706,7 @@ $HorzAlign = Center
textWriter.WriteElementString("PromptDeleteLines", settings.General.PromptDeleteLines.ToString());
textWriter.WriteElementString("Undocked", settings.General.Undocked.ToString());
textWriter.WriteElementString("UndockedVideoPosition", settings.General.UndockedVideoPosition);
textWriter.WriteElementString("UndockedVideoFullscreen", settings.General.UndockedVideoFullscreen.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("UndockedWaveformPosition", settings.General.UndockedWaveformPosition);
textWriter.WriteElementString("UndockedVideoControlsPosition", settings.General.UndockedVideoControlsPosition);
textWriter.WriteElementString("WaveformCenter", settings.General.WaveformCenter.ToString());

View File

@ -11268,6 +11268,7 @@ namespace Nikse.SubtitleEdit.Forms
{
if (_videoPlayerUndocked != null && !_videoPlayerUndocked.IsDisposed)
{
Configuration.Settings.General.UndockedVideoFullscreen = _videoPlayerUndocked.IsFullscreen;
Configuration.Settings.General.UndockedVideoPosition = _videoPlayerUndocked.Left + @";" + _videoPlayerUndocked.Top + @";" + _videoPlayerUndocked.Width + @";" + _videoPlayerUndocked.Height;
}
@ -14386,7 +14387,7 @@ namespace Nikse.SubtitleEdit.Forms
}
else if (e.KeyData == _mainVideoFullscreen) // fullscreen
{
GoFullscreen();
GoFullscreen(false);
e.SuppressKeyPress = true;
}
else if (e.KeyData == _mainVideoSlower)
@ -15504,9 +15505,9 @@ namespace Nikse.SubtitleEdit.Forms
}
}
private void GoFullscreen()
private void GoFullscreen(bool force)
{
if (mediaPlayer.VideoPlayer == null)
if (mediaPlayer.VideoPlayer == null && !force)
{
return;
}
@ -17414,7 +17415,7 @@ namespace Nikse.SubtitleEdit.Forms
}
else
{
GoFullscreen();
GoFullscreen(false);
}
}
}
@ -19122,6 +19123,10 @@ namespace Nikse.SubtitleEdit.Forms
{
Configuration.Settings.General.Undocked = false;
UndockVideoControlsToolStripMenuItemClick(null, null);
if (Configuration.Settings.General.UndockedVideoFullscreen)
{
GoFullscreen(true);
}
}
Main_Resize(null, null);