added new setting to start with maximized window

This commit is contained in:
Frank Skare
2019-08-21 16:52:09 +02:00
parent e230f0f474
commit 8debcc171c
6 changed files with 23 additions and 14 deletions

View File

@@ -1,7 +1,6 @@
###
- osc=yes and input-media-keys=yes was enforced,
now it can be disabled in mpv.conf
- added new setting to start with maximized window
### 5.3

View File

@@ -80,7 +80,7 @@ Table of contents
- Screenshot feature with many options
- File history feature to log time and filename
- A-B loop feature
- watch later feature to save the position
- Watch later feature to save the position
- [Manual](#manual)
### Screenshots

View File

@@ -23,6 +23,7 @@ namespace mpvnet
public static bool RememberHeight { get; set; } = true;
public static bool RememberPosition { get; set; }
public static bool Maximized { get; set; }
public static bool DebugMode { get; set; }
public static bool IsStartedFromTerminal { get; } = Environment.GetEnvironmentVariable("_started_from_console") == "yes";
public static bool RememberVolume { get; set; } = true;
@@ -106,6 +107,7 @@ namespace mpvnet
switch (name)
{
case "remember-position": RememberPosition = value == "yes"; return true;
case "maximized": Maximized = value == "yes"; return true;
case "start-size": RememberHeight = value == "previous"; return true;
case "process-instance": ProcessInstance = value; return true;
case "dark-mode": DarkMode = value; return true;

View File

@@ -45,6 +45,14 @@ help = "Save the window position on exit. (mpv.net specific setting)"
options = [{ name = "yes" },
{ name = "no" }]
[[settings]]
name = "maximized"
default = "no"
filter = "Screen"
help = "Start with a maximized window. (mpv.net specific setting)"
options = [{ name = "yes" },
{ name = "no" }]
[[settings]]
name = "remember-volume"
default = "yes"

View File

@@ -83,6 +83,8 @@ namespace mpvnet
Left = posX - Width / 2;
Top = posY - Height / 2;
}
if (App.Maximized) WindowState = FormWindowState.Maximized;
}
catch (Exception ex)
{
@@ -104,7 +106,7 @@ namespace mpvnet
void ContextMenu_Opened(object sender, EventArgs e) => CursorHelp.Show();
bool IsFullscreen => WindowState == FormWindowState.Maximized;
bool IsFullscreen => WindowState == FormWindowState.Maximized && FormBorderStyle == FormBorderStyle.None;
bool IsMouseInOSC() => PointToClient(Control.MousePosition).Y > ClientSize.Height * 0.9;
@@ -228,6 +230,9 @@ namespace mpvnet
void SetFormPosAndSize()
{
if (WindowState == FormWindowState.Maximized)
return;
if (mp.Fullscreen)
{
CycleFullscreen(true);
@@ -320,7 +325,7 @@ namespace mpvnet
}
else
{
if (WindowState == FormWindowState.Maximized)
if (WindowState == FormWindowState.Maximized && FormBorderStyle == FormBorderStyle.None)
{
WindowState = FormWindowState.Normal;

View File

@@ -103,10 +103,8 @@ namespace mpvnet
}
set_property_string("wid", MainForm.Hwnd.ToString());
if (!Conf.Keys.Contains("osc")) set_property_string("osc", "yes");
if (!Conf.Keys.Contains("input-media-keys")) set_property_string("input-media-keys", "yes");
set_property_string("osc", "yes");
set_property_string("input-media-keys", "yes");
set_property_string("force-window", "yes");
set_property_string("config-dir", ConfigFolder);
set_property_string("config", "yes");
@@ -418,11 +416,8 @@ namespace mpvnet
static void HideLogo()
{
if (IsLogoVisible)
{
commandv("overlay-remove", "0");
IsLogoVisible = false;
}
command("overlay-remove 0");
IsLogoVisible = false;
}
static List<PythonEventObject> PythonEventObjects = new List<PythonEventObject>();