window-scale property support
This commit is contained in:
@@ -72,6 +72,8 @@ namespace mpvnet
|
|||||||
|
|
||||||
Core.ObservePropertyInt("edition", PropChangeEdition);
|
Core.ObservePropertyInt("edition", PropChangeEdition);
|
||||||
|
|
||||||
|
Core.ObservePropertyDouble("window-scale", WindowScale);
|
||||||
|
|
||||||
if (Core.GPUAPI != "vulkan")
|
if (Core.GPUAPI != "vulkan")
|
||||||
Core.ProcessCommandLine(false);
|
Core.ProcessCommandLine(false);
|
||||||
|
|
||||||
@@ -163,6 +165,19 @@ namespace mpvnet
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowScale(double scale)
|
||||||
|
{
|
||||||
|
if (!WasShown)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BeginInvoke(new Action(() => {
|
||||||
|
SetSize(
|
||||||
|
(int)(Core.VideoSize.Width * scale),
|
||||||
|
(int)Math.Ceiling(Core.VideoSize.Height * scale),
|
||||||
|
Screen.FromControl(this), false);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
void Core_Shutdown() => BeginInvoke(new Action(() => Close()));
|
void Core_Shutdown() => BeginInvoke(new Action(() => Close()));
|
||||||
|
|
||||||
void Core_Idle() => SetTitle();
|
void Core_Idle() => SetTitle();
|
||||||
|
|||||||
Reference in New Issue
Block a user