From 117828f9f90c57080c9663372a8fcdc78464c250 Mon Sep 17 00:00:00 2001 From: Richasy Date: Thu, 4 Nov 2021 14:17:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E9=9B=86=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E8=A7=86=E5=9B=BE=20(#589)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controls/Player/Related/EpisodeView.xaml | 195 ++++++++++++------ .../Player/Related/VideoPartView.xaml | 148 +++++++++---- .../Resources/Strings/zh-CN/Resources.resw | 3 + src/Models/Models.Enums/App/LanguageNames.cs | 1 + src/Models/Models.Enums/App/SettingNames.cs | 1 + .../PlayerViewModel.Properties.cs | 6 + .../Common/PlayerViewModel/PlayerViewModel.cs | 4 + 7 files changed, 247 insertions(+), 111 deletions(-) diff --git a/src/App/Controls/Player/Related/EpisodeView.xaml b/src/App/Controls/Player/Related/EpisodeView.xaml index d52a2e2c3..cd8aade0d 100644 --- a/src/App/Controls/Player/Related/EpisodeView.xaml +++ b/src/App/Controls/Player/Related/EpisodeView.xaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="using:Richasy.Bili.App.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:loc="using:Richasy.Bili.Locator.Uwp" xmlns:local="using:Richasy.Bili.App.Controls.Player.Related" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:muxc="using:Microsoft.UI.Xaml.Controls" @@ -12,74 +13,134 @@ d:DesignWidth="400" mc:Ignorable="d"> - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + Padding="12" + HorizontalAlignment="Stretch" + ColumnSpacing="12"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HorizontalAlignment="Center" + VerticalAlignment="Center" + FontWeight="Bold" + Text="{x:Bind Data.Index, Mode=OneWay}" /> - - - - - - - - - - - - + + + + + + + + diff --git a/src/App/Controls/Player/Related/VideoPartView.xaml b/src/App/Controls/Player/Related/VideoPartView.xaml index 93b288381..480c38b54 100644 --- a/src/App/Controls/Player/Related/VideoPartView.xaml +++ b/src/App/Controls/Player/Related/VideoPartView.xaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="using:Richasy.Bili.App.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:loc="using:Richasy.Bili.Locator.Uwp" xmlns:local="using:Richasy.Bili.App.Controls.Player.Related" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:muxc="using:Microsoft.UI.Xaml.Controls" @@ -12,48 +13,107 @@ d:DesignWidth="400" mc:Ignorable="d"> - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/App/Resources/Strings/zh-CN/Resources.resw b/src/App/Resources/Strings/zh-CN/Resources.resw index d05a9bf38..17f3c97bb 100644 --- a/src/App/Resources/Strings/zh-CN/Resources.resw +++ b/src/App/Resources/Strings/zh-CN/Resources.resw @@ -716,6 +716,9 @@ 仅音频 + + 仅显示序号 + 仅字幕 diff --git a/src/Models/Models.Enums/App/LanguageNames.cs b/src/Models/Models.Enums/App/LanguageNames.cs index 8362f0663..03e553c50 100644 --- a/src/Models/Models.Enums/App/LanguageNames.cs +++ b/src/Models/Models.Enums/App/LanguageNames.cs @@ -387,6 +387,7 @@ public enum LanguageNames OpenDownloadPage, IgnoreVersion, PreRelease, + OnlyIndex, #pragma warning restore SA1602 // Enumeration items should be documented } } diff --git a/src/Models/Models.Enums/App/SettingNames.cs b/src/Models/Models.Enums/App/SettingNames.cs index 015e9e854..a54e24489 100644 --- a/src/Models/Models.Enums/App/SettingNames.cs +++ b/src/Models/Models.Enums/App/SettingNames.cs @@ -42,6 +42,7 @@ public enum SettingNames DisableP2PCdn, IsContinusPlay, IgnoreVersion, + IsOnlyShowIndex, #pragma warning disable SA1602 // Enumeration items should be documented } } diff --git a/src/ViewModels/ViewModels.Uwp/Common/PlayerViewModel/PlayerViewModel.Properties.cs b/src/ViewModels/ViewModels.Uwp/Common/PlayerViewModel/PlayerViewModel.Properties.cs index 7d0de2f1b..15497dd8a 100644 --- a/src/ViewModels/ViewModels.Uwp/Common/PlayerViewModel/PlayerViewModel.Properties.cs +++ b/src/ViewModels/ViewModels.Uwp/Common/PlayerViewModel/PlayerViewModel.Properties.cs @@ -703,6 +703,12 @@ public partial class PlayerViewModel [Reactive] public bool IsShowInteractionEnd { get; set; } + /// + /// 是否仅显示分集索引. + /// + [Reactive] + public bool IsOnlyShowIndex { get; set; } + /// /// 索引列表. /// diff --git a/src/ViewModels/ViewModels.Uwp/Common/PlayerViewModel/PlayerViewModel.cs b/src/ViewModels/ViewModels.Uwp/Common/PlayerViewModel/PlayerViewModel.cs index 11e45ca74..d30777b06 100644 --- a/src/ViewModels/ViewModels.Uwp/Common/PlayerViewModel/PlayerViewModel.cs +++ b/src/ViewModels/ViewModels.Uwp/Common/PlayerViewModel/PlayerViewModel.cs @@ -62,6 +62,7 @@ public PlayerViewModel() CanShowSubtitle = _settingsToolkit.ReadLocalSetting(SettingNames.CanShowSubtitle, true); Volume = _settingsToolkit.ReadLocalSetting(SettingNames.Volume, 100d); PlaybackRate = _settingsToolkit.ReadLocalSetting(SettingNames.PlaybackRate, 1d); + IsOnlyShowIndex = _settingsToolkit.ReadLocalSetting(SettingNames.IsOnlyShowIndex, false); InitializeTimer(); this.PropertyChanged += OnPropertyChanged; LiveDanmakuCollection.CollectionChanged += OnLiveDanmakuCollectionChanged; @@ -680,6 +681,9 @@ private void OnPropertyChanged(object sender, PropertyChangedEventArgs args) _settingsToolkit.WriteLocalSetting(SettingNames.PlaybackRate, PlaybackRate); break; + case nameof(IsOnlyShowIndex): + _settingsToolkit.WriteLocalSetting(SettingNames.IsOnlyShowIndex, IsOnlyShowIndex); + break; default: break; }