Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
支持鼠标中键及侧键返回 (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy authored Mar 25, 2022
1 parent ef53831 commit 965b288
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
1 change: 0 additions & 1 deletion src/App/Pages/Overlay/PlayerPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:loc="using:Richasy.Bili.Locator.Uwp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:pages="using:Richasy.Bili.App.Pages"
mc:Ignorable="d">

Expand Down
19 changes: 0 additions & 19 deletions src/App/Pages/Overlay/PlayerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,6 @@ protected override void OnNavigatedFrom(NavigationEventArgs e)
CoreViewModel.IsOverLayerExtendToTitleBar = false;
}

/// <inheritdoc/>
protected override void OnPointerReleased(PointerRoutedEventArgs e)
{
if (e.GetCurrentPoint(this).Properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.XButton1Released)
{
e.Handled = true;
if (ViewModel.PlayerDisplayMode != PlayerDisplayMode.Default)
{
ViewModel.PlayerDisplayMode = PlayerDisplayMode.Default;
}
else
{
CoreViewModel.Back();
}
}

base.OnPointerReleased(e);
}

private async void OnLoadedAsync(object sender, RoutedEventArgs e)
{
ViewModel.PropertyChanged += OnViewModelPropertyChanged;
Expand Down
2 changes: 1 addition & 1 deletion src/App/Pages/RootPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
muxc:BackdropMaterial.ApplyToRootOrPageBackground="True"
mc:Ignorable="d">

<Grid>
<Grid Background="{ThemeResource SystemControlTransparentBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
Expand Down
4 changes: 3 additions & 1 deletion src/App/Pages/RootPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
/// <inheritdoc/>
protected override void OnPointerReleased(PointerRoutedEventArgs e)
{
if (e.GetCurrentPoint(this).Properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.XButton1Released)
var kind = e.GetCurrentPoint(this).Properties.PointerUpdateKind;
if (kind == Windows.UI.Input.PointerUpdateKind.XButton1Released
|| kind == Windows.UI.Input.PointerUpdateKind.MiddleButtonReleased)
{
e.Handled = true;
CoreViewModel.Back();
Expand Down

0 comments on commit 965b288

Please sign in to comment.