Skip to content

Commit f6f4f85

Browse files
authored
修复全屏状态下的播放器白边问题 (#964)
1 parent 19ba326 commit f6f4f85

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

src/Desktop/BiliCopilot.UI/Controls/RootLayout.xaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,7 @@
110110
MenuItemsSource="{x:Bind ViewModel.MenuItems, Mode=OneWay}"
111111
SelectionFollowsFocus="Disabled"
112112
Style="{StaticResource MainNavigationViewStyle}">
113-
<Grid
114-
x:Name="MainGrid"
115-
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
116-
BorderThickness="1,1,0,0">
113+
<Grid x:Name="MainGrid">
117114
<Grid Visibility="{x:Bind _appViewModel.IsInitialLoading, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}">
118115
<Frame x:Name="MainFrame" Visibility="{x:Bind ViewModel.IsOverlayOpen, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}" />
119116
<Grid x:Name="OverlayGrid" Visibility="{x:Bind ViewModel.IsOverlayOpen, Mode=OneWay}">

src/Desktop/BiliCopilot.UI/Controls/RootLayout.xaml.cs

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public void PrepareFullPlayerPresenter(PlayerDisplayMode mode)
5050
SecondaryTitleBar.BackIcon = mode == PlayerDisplayMode.FullWindow ? FluentIcons.Common.Symbol.WindowAd : FluentIcons.Common.Symbol.ContractDownLeft;
5151
this.Get<AppViewModel>().ActivatedWindow.AppWindow.TitleBar.PreferredHeightOption = Microsoft.UI.Windowing.TitleBarHeightOption.Standard;
5252
NavView.IsPaneOpen = false;
53+
VisualStateManager.GoToState(NavView, "PaneCollapsed", false);
5354
VisualStateManager.GoToState(this, nameof(PlayerState), false);
5455

5556
if (OverlayFrame.Content is VideoPlayerPage vPage)
@@ -92,6 +93,7 @@ public void ExitFullPlayerPresenter()
9293
SecondaryTitleBar.IsBackButtonVisible = false;
9394
this.Get<AppViewModel>().ActivatedWindow.AppWindow.TitleBar.PreferredHeightOption = Microsoft.UI.Windowing.TitleBarHeightOption.Tall;
9495
NavView.IsPaneOpen = true;
96+
VisualStateManager.GoToState(NavView, "PaneVisible", false);
9597
VisualStateManager.GoToState(this, nameof(NormalState), false);
9698

9799
if (OverlayFrame.Content is VideoPlayerPage vPage)

src/Desktop/BiliCopilot.UI/ViewModels/Core/SubtitleViewModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void UpdatePosition(int position)
8585
/// <summary>
8686
/// 清除字幕.
8787
/// </summary>
88-
public void ClearSubttile()
88+
public void ClearSubtitle()
8989
=> CurrentSubtitle = default;
9090

9191
/// <summary>

src/Desktop/BiliCopilot.UI/ViewModels/View/PgcPlayerPageViewModel/PgcPlayerPageViewModel.Operations.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ private void PlayerMediaEnded()
357357
{
358358
// 清除弹幕.
359359
Danmaku.ClearDanmaku();
360-
Subtitle.ClearSubttile();
360+
Subtitle.ClearSubtitle();
361361

362362
ReportProgressCommand.Execute(Player.Duration);
363363

src/Desktop/BiliCopilot.UI/ViewModels/View/VideoPlayerPageViewModel/VideoPlayerPageViewModel.Operations.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ private void PlayerMediaEnded()
340340
{
341341
// 清除弹幕.
342342
Danmaku.ClearDanmaku();
343-
Subtitle.ClearSubttile();
343+
Subtitle.ClearSubtitle();
344344

345345
ReportProgressCommand.Execute(Player.Duration);
346346

src/Libs/WinUI.Share

0 commit comments

Comments
 (0)