fix issue enlarging or shrinking the window size via keyboard

This commit is contained in:
Frank Skare
2020-03-17 00:18:09 +01:00
parent 6b3c2788df
commit ece15ca9bb
7 changed files with 23 additions and 18 deletions

View File

@@ -11,6 +11,8 @@
- fix: update routine did only work when mpv.net was located in 'Program Files' - fix: update routine did only work when mpv.net was located in 'Program Files'
- fix: errors were just ignored and only seen printed in the terminal in case mpv.net - fix: errors were just ignored and only seen printed in the terminal in case mpv.net
was started from the terminal, now for every error a message box is shown was started from the terminal, now for every error a message box is shown
- fix: when start-size=video was used then enlarging or shrinking the window
size was broken
### 5.4.4.0 ### 5.4.4.0

View File

@@ -358,7 +358,7 @@ public class TaskDialog<T> : TaskDialogNative, IDisposable
return value; return value;
} }
public void AddCommandLink(string text, T value) public void AddCommand(string text, T value)
{ {
int n = 1000 + IdValueDic.Count + 1; int n = 1000 + IdValueDic.Count + 1;
IdValueDic[n] = value; IdValueDic[n] = value;
@@ -367,7 +367,7 @@ public class TaskDialog<T> : TaskDialogNative, IDisposable
Config.dwFlags |= TaskDialogNative.TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS; Config.dwFlags |= TaskDialogNative.TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS;
} }
public void AddCommandLink(string text, string description, T value, bool setShield = false) public void AddCommand(string text, string description, T value, bool setShield = false)
{ {
int n = 1000 + IdValueDic.Count + 1; int n = 1000 + IdValueDic.Count + 1;
IdValueDic[n] = value; IdValueDic[n] = value;

View File

@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Frank Skare (stax76)")] [assembly: AssemblyCompany("Frank Skare (stax76)")]
[assembly: AssemblyProduct("mpv.net")] [assembly: AssemblyProduct("mpv.net")]
[assembly: AssemblyCopyright("Copyright (c) 2017-2019 Frank Skare (stax76)")] [assembly: AssemblyCopyright("Copyright (C) 2017-2020 Frank Skare (stax76)")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]

View File

@@ -1,6 +1,6 @@
# This file defines the key and mouse bindings and the context menu # This file defines the key and mouse bindings and the context menu
# of mpv.net. A input and config editor can be found in mpv.net's # of mpv.net. A input and config editor can be found in mpv.nets
# context menu under 'Settings'. The defaults of this file can be found at: # context menu under 'Settings'. The defaults of this file can be found at:
# https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt # https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt
@@ -12,7 +12,7 @@
# mpv.net's defaults of mpv.conf contain: 'input-default-bindings = no' # mpv.net's defaults of mpv.conf contain: 'input-default-bindings = no'
# which disables mpv's input defaults. Every line in this file begins with a # which disables mpv's input defaults. Every line in this file begins with a
# space character to make it easier to do a text search, so if you want to know # space character to make it easier to do a text search, so if you want to know
# if 'o' has already a binding you can make a text search on ' o '. # if 'o' has already a binding you can do a text search on ' o '.
# mpv input commands: https://mpv.io/manual/master/#list-of-input-commands # mpv input commands: https://mpv.io/manual/master/#list-of-input-commands

View File

@@ -137,12 +137,13 @@ namespace mpvnet
Everything_GetResultFullPathName(i, buf, bufsize); Everything_GetResultFullPathName(i, buf, bufsize);
string ext = buf.ToString().ShortExt(); string ext = buf.ToString().ShortExt();
if (App.AudioTypes.Contains(ext) || App.VideoTypes.Contains(ext) || if (App.AudioTypes.Contains(ext) || App.VideoTypes.Contains(ext)
App.ImageTypes.Contains(ext)) || App.ImageTypes.Contains(ext))
items.Add(buf.ToString()); items.Add(buf.ToString());
if (items.Count > 100) break; if (items.Count > 100)
break;
} }
Application.Current.Dispatcher.Invoke(() => { Application.Current.Dispatcher.Invoke(() => {

View File

@@ -279,9 +279,9 @@ namespace mpvnet
Size size = mp.VideoSize; Size size = mp.VideoSize;
int height = size.Height; int height = size.Height;
if (App.RememberHeight) if (App.RememberHeight || scale != 1)
{ {
if (WasInitialSizeSet) if (WasInitialSizeSet || scale != 1)
height = ClientSize.Height; height = ClientSize.Height;
else else
{ {
@@ -595,7 +595,7 @@ namespace mpvnet
{ {
if (value != 1) if (value != 1)
{ {
BeginInvoke(new Action(() => SetFormPosAndSize(value))); Invoke(new Action(() => SetFormPosAndSize(value)));
mp.command("no-osd set window-scale 1"); mp.command("no-osd set window-scale 1");
} }
} }

View File

@@ -172,9 +172,9 @@ namespace mpvnet
using (TaskDialog<string> td = new TaskDialog<string>()) using (TaskDialog<string> td = new TaskDialog<string>())
{ {
td.MainInstruction = "Choose a settings folder."; td.MainInstruction = "Choose a settings folder.";
td.AddCommandLink(@"AppData\Roaming\mpv.net", appdataFolder, appdataFolder); td.AddCommand(@"AppData\Roaming\mpv.net", appdataFolder, appdataFolder);
td.AddCommandLink(@"<startup>\portable_config", portableFolder, portableFolder); td.AddCommand(@"<startup>\portable_config", portableFolder, portableFolder);
td.AddCommandLink("Choose custom folder", "custom"); td.AddCommand("Choose custom folder", "custom");
_ConfigFolder = td.Show(); _ConfigFolder = td.Show();
} }
@@ -712,11 +712,13 @@ namespace mpvnet
switch (argument) switch (argument)
{ {
case "--list-properties=yes": case "--list-properties=yes":
{
var list = get_property_string("property-list").Split(',').ToList(); var list = get_property_string("property-list").Split(',').ToList();
list.Sort(); list.Sort();
Console.WriteLine(string.Join("\r\n", list.ToArray())); Console.WriteLine(string.Join("\n", list.ToArray()));
return true; return true;
} }
}
return false; return false;
} }