Skip to content

Commit e3fdeff

Browse files
committed
修复标题栏动画及搜索框聚焦问题
1 parent 6799950 commit e3fdeff

File tree

6 files changed

+23
-4
lines changed

6 files changed

+23
-4
lines changed

src/Desktop/BiliCopilot.UI/Controls/Components/AppSearchBox.xaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@
101101
<Flyout
102102
x:Name="HotSearchFlyout"
103103
Opened="OnHotSearchFlyoutOpened"
104-
Placement="BottomEdgeAlignedLeft">
104+
Placement="BottomEdgeAlignedLeft"
105+
ShouldConstrainToRootBounds="False">
105106
<Flyout.FlyoutPresenterStyle>
106107
<Style BasedOn="{StaticResource DefaultFlyoutPresenterStyle}" TargetType="FlyoutPresenter">
107108
<Setter Property="Padding" Value="0" />

src/Desktop/BiliCopilot.UI/Controls/Core/Player/BiliPlayer.Methods.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ private void CheckTransportControlVisibility(PointerRoutedEventArgs? args = defa
6464
{
6565
if (args is not null)
6666
{
67+
if (_transportControl != null)
68+
{
69+
_lastRelativeMTCPoint = args.GetCurrentPoint(_transportControl).Position;
70+
}
71+
6772
_lastPointerPoint = args.GetCurrentPoint(_overlayContainer).Position;
6873
}
6974

@@ -73,7 +78,12 @@ private void CheckTransportControlVisibility(PointerRoutedEventArgs? args = defa
7378
return;
7479
}
7580

76-
var isInStayArea = _transportControlTriggerRect.Contains(_lastPointerPoint ?? new(0, 0));
81+
var isInStayArea = _lastRelativeMTCPoint != null
82+
&& _lastRelativeMTCPoint.Value.X >= 0
83+
&& _lastRelativeMTCPoint.Value.Y >= 0
84+
&& _lastRelativeMTCPoint.Value.X <= _transportControl.ActualWidth
85+
&& _lastRelativeMTCPoint.Value.Y <= _transportControl.ActualHeight;
86+
7787
var shouldShow = isInStayArea;
7888
if (!isInStayArea)
7989
{
@@ -106,6 +116,7 @@ private void SetTransportVisibility(bool isVisible)
106116
}
107117

108118
_transportControl.Visibility = visibility;
119+
MeasureTransportTriggerRect();
109120
}
110121

111122
private void OnCursorTimerTick(object? sender, object e)

src/Desktop/BiliCopilot.UI/Controls/Core/Player/BiliPlayer.cs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public sealed partial class BiliPlayer : PlayerControlBase
2424
private bool _isCursorDisposed;
2525
private bool _needRemeasureSize = true;
2626
private Point? _lastPointerPoint;
27+
private Point? _lastRelativeMTCPoint;
2728
private bool _isDoubleTapped;
2829

2930
private double _manipulationDeltaX;

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

+7
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public void PrepareFullPlayerPresenter(PlayerDisplayMode mode)
7373
SecondaryTitleBar.Title = wPage.ViewModel.Title;
7474
wPage.EnterPlayerHostMode();
7575
}
76+
77+
MainTitleBar.DelayUpdateAsync();
78+
SecondaryTitleBar.DelayUpdateAsync();
7679
}
7780

7881
/// <summary>
@@ -86,6 +89,7 @@ public void ExitFullPlayerPresenter()
8689
}
8790

8891
MainTitleBar.Visibility = Visibility.Visible;
92+
8993
SecondaryTitleBar.Visibility = Visibility.Collapsed;
9094
SecondaryTitleBar.IsBackButtonVisible = false;
9195
this.Get<AppViewModel>().ActivatedWindow.AppWindow.TitleBar.PreferredHeightOption = Microsoft.UI.Windowing.TitleBarHeightOption.Tall;
@@ -108,6 +112,9 @@ public void ExitFullPlayerPresenter()
108112
{
109113
wPage.ExitPlayerHostMode();
110114
}
115+
116+
MainTitleBar.DelayUpdateAsync();
117+
SecondaryTitleBar.DelayUpdateAsync();
111118
}
112119

113120
/// <summary>

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

-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ private void ClearView()
176176
AvId = default;
177177
BvId = default;
178178
FavoriteFolders = default;
179-
HasNextVideo = false;
180179
SelectedFormat = default;
181180
}
182181

src/Libs/WinUI.Share

0 commit comments

Comments
 (0)