added new setting to start with maximized window
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user