#140 Fix window size not being saved

This commit is contained in:
Frank Skare
2021-06-17 16:32:35 +02:00
parent 8420abd915
commit ebacaa0341
3 changed files with 12 additions and 6 deletions

View File

@@ -2,9 +2,11 @@
5.4.9.1 (2021-0?-??) 5.4.9.1 (2021-0?-??)
==================== ====================
- New media info command: Ctrl+m script-message mpv.net show-media-info #menu: View > Show Media Info - New media info command: `Ctrl+m script-message mpv.net show-media-info #menu: View > Show Media Info`
- Context menu font render quality fix. - Context menu font render quality fix.
- Context menu and cycle-audio command support external audio and subtitle tracks. - Context menu and `cycle-audio` command support external audio and subtitle tracks.
- Fix window size not being saved.
- libmpv shinchiro 2021-06-06
5.4.9.0 (2021-05-29) 5.4.9.0 (2021-05-29)

View File

@@ -35,14 +35,14 @@ class Script
{ {
FileToDelete = Core.get_property_string("path"); FileToDelete = Core.get_property_string("path");
DeleteTime = DateTime.Now; DeleteTime = DateTime.Now;
Core.commandv("show-text", "Press 1 to delete file", "5000"); Core.commandv("show-text", "Press 1 to delete file", "10000");
} }
else if (args[1] == "confirm") else if (args[1] == "confirm")
{ {
TimeSpan ts = DateTime.Now - DeleteTime; TimeSpan ts = DateTime.Now - DeleteTime;
string path = Core.get_property_string("path"); string path = Core.get_property_string("path");
if (FileToDelete == path && ts.TotalSeconds < 5 && File.Exists(FileToDelete)) if (FileToDelete == path && ts.TotalSeconds < 10 && File.Exists(FileToDelete))
{ {
Core.command("playlist-remove current"); Core.command("playlist-remove current");
int pos = Core.get_property_int("playlist-pos"); int pos = Core.get_property_int("playlist-pos");
@@ -53,6 +53,11 @@ class Script
if (count > 0) if (count > 0)
Core.set_property_int("playlist-pos", count - 1); Core.set_property_int("playlist-pos", count - 1);
else
{
Core.ShowLogo();
Core.commandv("show-text", "");
}
} }
Thread.Sleep(2000); Thread.Sleep(2000);

View File

@@ -403,6 +403,7 @@ namespace mpvnet
} }
SetSize(width, height, screen, checkAutofit); SetSize(width, height, screen, checkAutofit);
SaveWindowProperties();
} }
void SetSize(int width, int height, Screen screen, bool checkAutofit = true) void SetSize(int width, int height, Screen screen, bool checkAutofit = true)
@@ -553,7 +554,6 @@ namespace mpvnet
FormBorderStyle = FormBorderStyle.None; FormBorderStyle = FormBorderStyle.None;
SetFormPosAndSize(); SetFormPosAndSize();
SaveWindowProperties();
} }
} }
} }
@@ -980,7 +980,6 @@ namespace mpvnet
protected override void OnFormClosing(FormClosingEventArgs e) protected override void OnFormClosing(FormClosingEventArgs e)
{ {
base.OnFormClosing(e); base.OnFormClosing(e);
SaveWindowProperties();
if (Core.IsQuitNeeded) if (Core.IsQuitNeeded)
Core.commandv("quit"); Core.commandv("quit");