From 831f8d2c43a01e38f63a96044e04dd603a52afad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3?= Date: Sat, 19 Oct 2024 14:16:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=92=AD=E6=94=BE=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=8F=8C=E5=87=BB=E5=9C=A8=E5=85=A8=E5=B1=8F=E5=92=8C?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=8C=96=E5=88=87=E6=8D=A2=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/Config.cs | 4 +-- Desktop/Views/Windows/VlcPlayWindow.xaml.cs | 34 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Core/Config.cs b/Core/Config.cs index cfa3fdb9..1c5517c4 100644 --- a/Core/Config.cs +++ b/Core/Config.cs @@ -750,10 +750,10 @@ public string _MainDomainName } } - private static string HTTP_UA = $"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0"; + private static string HTTP_UA = $"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0"; /// /// 请求是默认使用的UA(字符串) - /// 默认值:$"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0" + /// 默认值:$"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0" /// public string _HTTP_UA { get { return HTTP_UA; } } diff --git a/Desktop/Views/Windows/VlcPlayWindow.xaml.cs b/Desktop/Views/Windows/VlcPlayWindow.xaml.cs index 0b492680..e7061835 100644 --- a/Desktop/Views/Windows/VlcPlayWindow.xaml.cs +++ b/Desktop/Views/Windows/VlcPlayWindow.xaml.cs @@ -18,6 +18,7 @@ using Key = System.Windows.Input.Key; using MenuItem = Wpf.Ui.Controls.MenuItem; + namespace Desktop.Views.Windows { /// @@ -60,6 +61,10 @@ public partial class VlcPlayWindow : FluentWindow /// 宽高比是否初始化 /// public bool InitializeAspectRatio = false; + /// + /// 用于跟踪当前是否为全屏状态 + /// + public bool isFullScreen = false; public class DanMuOrbitInfo { public string Text { get; set; } @@ -398,10 +403,37 @@ private void FluentWindow_Closing(object sender, System.ComponentModel.CancelEve } } + private DateTime lastClickTime = DateTime.MinValue; // 上次点击的时间 private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { this.DragMove(); + DateTime now = DateTime.Now; + // 检查是否为双击(两次点击间隔小于系统双击时间) + if ((now - lastClickTime).TotalMilliseconds <= SystemInformation.DoubleClickTime) + { + ToggleFullScreen(); + } + lastClickTime = now; + } + private void ToggleFullScreen() + { + if (!isFullScreen) + { + // 切换到全屏模式 + this.WindowStyle = WindowStyle.None; + this.WindowState = WindowState.Maximized; + this.ResizeMode = ResizeMode.NoResize; + isFullScreen = true; + } + else + { + // 切换回窗口模式 + this.WindowStyle = WindowStyle.SingleBorderWindow; + this.WindowState = WindowState.Normal; + this.ResizeMode = ResizeMode.CanResize; + isFullScreen = false; + } } private void Grid_MouseWheel(object sender, MouseWheelEventArgs e) @@ -682,5 +714,7 @@ private void MenuItem_OpenLiveUlr_Click(object sender, RoutedEventArgs e) }; Process.Start(psi); } + + } }