From 48d2426234520798f34f852fd261dece3ffb25d3 Mon Sep 17 00:00:00 2001 From: ProJend Date: Thu, 5 Dec 2024 18:36:39 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E8=87=B3C#=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.JSBridge/BiliLite.JSBridge.csproj | 1 + src/BiliLite.UWP/BiliLite.UWP.csproj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BiliLite.JSBridge/BiliLite.JSBridge.csproj b/src/BiliLite.JSBridge/BiliLite.JSBridge.csproj index f815d6fb..c11e0309 100644 --- a/src/BiliLite.JSBridge/BiliLite.JSBridge.csproj +++ b/src/BiliLite.JSBridge/BiliLite.JSBridge.csproj @@ -2,6 +2,7 @@ + latest Debug AnyCPU {809C7636-0AF1-4695-9230-22F74D7B1327} diff --git a/src/BiliLite.UWP/BiliLite.UWP.csproj b/src/BiliLite.UWP/BiliLite.UWP.csproj index 13c5a859..cb97f8f9 100644 --- a/src/BiliLite.UWP/BiliLite.UWP.csproj +++ b/src/BiliLite.UWP/BiliLite.UWP.csproj @@ -10,7 +10,7 @@ BiliLite BiliLite zh-cn - 8.0 + latest UAP 10.0.19041.0 10.0.18362.0 From af3e61ae8077d875808ea6aab905fb6923fb5566 Mon Sep 17 00:00:00 2001 From: ProJend Date: Sat, 7 Dec 2024 16:04:51 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E8=B0=83=E6=95=B4TabView=E5=8F=AF?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=9A=84=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.UWP/MainPage.xaml | 1 - src/BiliLite.UWP/MainPage.xaml.cs | 8 -------- src/BiliLite.UWP/Styles/TabViewStyle.xaml | 15 +++++---------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/BiliLite.UWP/MainPage.xaml b/src/BiliLite.UWP/MainPage.xaml index 01fb1013..7182bda7 100644 --- a/src/BiliLite.UWP/MainPage.xaml +++ b/src/BiliLite.UWP/MainPage.xaml @@ -25,7 +25,6 @@ PreviewKeyDown="TabView_OnPreviewKeyDown" TabCloseRequested="TabView_TabCloseRequested" TabItemsChanged="tabView_TabItemsChanged" - LayoutUpdated="TabView_OnLayoutUpdated" TabWidthMode="SizeToContent"> (); - if (tabList == null) return; - tabList.MaxWidth = tabView.ActualWidth - 175; - } } } diff --git a/src/BiliLite.UWP/Styles/TabViewStyle.xaml b/src/BiliLite.UWP/Styles/TabViewStyle.xaml index 2fdb4d6c..e19a14a6 100644 --- a/src/BiliLite.UWP/Styles/TabViewStyle.xaml +++ b/src/BiliLite.UWP/Styles/TabViewStyle.xaml @@ -24,16 +24,10 @@ - + - + @@ -93,6 +87,7 @@ - + - + From 3d80d1751d2731f74782bb09921082c840475a00 Mon Sep 17 00:00:00 2001 From: ProJend Date: Sat, 7 Dec 2024 19:54:04 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E9=80=82=E5=BD=93=E8=B0=83=E6=95=B4TabVi?= =?UTF-8?q?ew=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.UWP/Styles/TabViewStyle.xaml | 27 +++++++++-------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/BiliLite.UWP/Styles/TabViewStyle.xaml b/src/BiliLite.UWP/Styles/TabViewStyle.xaml index e19a14a6..010480e3 100644 --- a/src/BiliLite.UWP/Styles/TabViewStyle.xaml +++ b/src/BiliLite.UWP/Styles/TabViewStyle.xaml @@ -20,7 +20,7 @@ - + @@ -68,7 +68,7 @@ @@ -123,7 +123,7 @@ - + @@ -185,7 +185,7 @@ x:Name="TabContainer" Grid.Column="1" Margin="0,-4,0,-6" - Padding="{ThemeResource TabViewItemHeaderPadding}" + Padding="15,0" Background="{ThemeResource TabViewRightContentPresenterColor}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" @@ -575,17 +575,11 @@ BorderThickness="{TemplateBinding BorderThickness}"> - + - - - + @@ -607,7 +601,6 @@ FontSize="10" Glyph="" /> - - - + @@ -728,7 +724,6 @@ x:Name="ContentPresenter" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" - contract7NotPresent:CornerRadius="{ThemeResource ControlCornerRadius}" AutomationProperties.AccessibilityView="Raw" Background="{TemplateBinding Background}" BackgroundSizing="{TemplateBinding BackgroundSizing}" From 4810f111460b9c9b5e4f9957ab2f84521b244dd5 Mon Sep 17 00:00:00 2001 From: ProJend Date: Sat, 7 Dec 2024 21:01:10 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E5=AE=9E=E7=8E=B0TabViewItem=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E8=87=AA=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controls/Settings/UISettingsControl.xaml | 12 ++++-------- src/BiliLite.UWP/Models/Common/SettingConstants.cs | 8 ++++---- src/BiliLite.UWP/Styles/TabViewStyle.xaml | 1 - 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml index 71de8f30..1c0ab1a8 100644 --- a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml +++ b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml @@ -332,14 +332,10 @@ - - - - - - + + + + diff --git a/src/BiliLite.UWP/Models/Common/SettingConstants.cs b/src/BiliLite.UWP/Models/Common/SettingConstants.cs index 77bcdb67..b50e412a 100644 --- a/src/BiliLite.UWP/Models/Common/SettingConstants.cs +++ b/src/BiliLite.UWP/Models/Common/SettingConstants.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using BiliLite.Models.Attributes; +using BiliLite.Models.Attributes; using BiliLite.Models.Common.Player; using BiliLite.Services; +using System.Collections.Generic; namespace BiliLite.Models.Common { @@ -233,7 +233,7 @@ public class UI public const string TAB_ITEM_MIN_WIDTH = "TabItemMinWidth"; [SettingDefaultValue] - public const double DEFAULT_TAB_ITEM_MIN_WIDTH = 192; + public const double DEFAULT_TAB_ITEM_MIN_WIDTH = 0; /// /// 是否启用动态磁贴 @@ -612,7 +612,7 @@ public class Player [SettingKey(typeof(object))] public const string FfmpegOptions = "FfmpegOptions"; - /// + /// /// 使用外站视频替换无法播放的视频 bool /// [SettingKey(typeof(bool))] diff --git a/src/BiliLite.UWP/Styles/TabViewStyle.xaml b/src/BiliLite.UWP/Styles/TabViewStyle.xaml index 010480e3..e1d7576d 100644 --- a/src/BiliLite.UWP/Styles/TabViewStyle.xaml +++ b/src/BiliLite.UWP/Styles/TabViewStyle.xaml @@ -124,7 +124,6 @@ - From d0fbf8aba6e632906ea15ae44835598b77fbd2fa Mon Sep 17 00:00:00 2001 From: ProJend Date: Tue, 10 Dec 2024 15:31:40 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0ImageViewerControl?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E8=BE=B9=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.UWP/MainPage.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BiliLite.UWP/MainPage.xaml b/src/BiliLite.UWP/MainPage.xaml index 7182bda7..93d9dde9 100644 --- a/src/BiliLite.UWP/MainPage.xaml +++ b/src/BiliLite.UWP/MainPage.xaml @@ -61,7 +61,7 @@ Visibility="Collapsed" /> From 41a62fb1577305217e2fb98ac438466e121a9dc3 Mon Sep 17 00:00:00 2001 From: ProJend Date: Tue, 10 Dec 2024 16:11:40 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E8=B0=83=E6=95=B4TabViewItem=E5=AF=B9?= =?UTF-8?q?=E7=A7=B0=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.UWP/Styles/TabViewStyle.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BiliLite.UWP/Styles/TabViewStyle.xaml b/src/BiliLite.UWP/Styles/TabViewStyle.xaml index e1d7576d..42eb98f1 100644 --- a/src/BiliLite.UWP/Styles/TabViewStyle.xaml +++ b/src/BiliLite.UWP/Styles/TabViewStyle.xaml @@ -68,7 +68,7 @@ @@ -184,7 +184,7 @@ x:Name="TabContainer" Grid.Column="1" Margin="0,-4,0,-6" - Padding="15,0" + Padding="15,0,5,0" Background="{ThemeResource TabViewRightContentPresenterColor}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" From 53287db456994f7630e819d7c8843f454f26d2d8 Mon Sep 17 00:00:00 2001 From: ProJend Date: Wed, 11 Dec 2024 00:47:51 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0TabViewItem=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E5=AE=BD=E5=BA=A6=E9=98=88=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml index 1c0ab1a8..3c7acc03 100644 --- a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml +++ b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml @@ -334,7 +334,7 @@ Description="是否固定标签页宽度(下次打开应用生效)"> - + From 30c300e69b877256f28888f5083f008ecc790ee8 Mon Sep 17 00:00:00 2001 From: ProJend Date: Wed, 11 Dec 2024 23:36:14 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=A1=B5=E7=9A=84=E5=AF=B9=E7=A7=B0=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.UWP/Styles/TabViewStyle.xaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/BiliLite.UWP/Styles/TabViewStyle.xaml b/src/BiliLite.UWP/Styles/TabViewStyle.xaml index 42eb98f1..1dc4a55f 100644 --- a/src/BiliLite.UWP/Styles/TabViewStyle.xaml +++ b/src/BiliLite.UWP/Styles/TabViewStyle.xaml @@ -183,8 +183,7 @@ Date: Mon, 16 Dec 2024 22:59:47 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E5=B0=BD=E9=87=8F=E5=87=8F=E5=B0=91?= =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E7=A9=BA=E7=99=BD=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.UWP/Styles/TabViewStyle.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BiliLite.UWP/Styles/TabViewStyle.xaml b/src/BiliLite.UWP/Styles/TabViewStyle.xaml index 1dc4a55f..69360f79 100644 --- a/src/BiliLite.UWP/Styles/TabViewStyle.xaml +++ b/src/BiliLite.UWP/Styles/TabViewStyle.xaml @@ -87,7 +87,7 @@ Date: Tue, 17 Dec 2024 12:53:47 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=A0=8F=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=BF=AE=E5=A4=8D=E6=92=AD=E6=94=BE=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E9=A1=B6=E9=83=A8=E8=B7=9D=E7=A6=BB=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controls/PlayerControl.xaml.cs | 10 +++------- .../Controls/Settings/UISettingsControl.xaml | 4 ++++ .../Settings/UISettingsControl.xaml.cs | 10 ++++++++++ src/BiliLite.UWP/MainPage.xaml | 1 - src/BiliLite.UWP/MainPage.xaml.cs | 19 ++++++++++++++++--- .../Models/Common/SettingConstants.cs | 6 ++++++ src/BiliLite.UWP/Pages/LiveDetailPage.xaml.cs | 13 +++++++++++++ .../Pages/SeasonDetailPage.xaml.cs | 8 +++++++- .../Pages/VideoDetailPage.xaml.cs | 11 +++++++++-- .../Services/FrostMasterDanmakuController.cs | 19 +------------------ .../Services/NsDanmakuController.cs | 19 +------------------ src/BiliLite.UWP/Styles/TabViewStyle.xaml | 2 +- .../ViewModels/Common/MainPageViewModel.cs | 5 +++++ 13 files changed, 76 insertions(+), 51 deletions(-) diff --git a/src/BiliLite.UWP/Controls/PlayerControl.xaml.cs b/src/BiliLite.UWP/Controls/PlayerControl.xaml.cs index 23b5d429..16558e6b 100644 --- a/src/BiliLite.UWP/Controls/PlayerControl.xaml.cs +++ b/src/BiliLite.UWP/Controls/PlayerControl.xaml.cs @@ -173,7 +173,7 @@ public PlayerControl() } else { - m_danmakuController = App.ServiceProvider.GetRequiredService(); + m_danmakuController = App.ServiceProvider.GetRequiredService(); m_danmakuController.Init(DanmakuCanvas); } } @@ -496,7 +496,7 @@ private void LoadPlayerSetting() { //音量 Player.Volume = SettingService.GetValue(SettingConstants.Player.PLAYER_VOLUME, SettingConstants.Player.DEFAULT_PLAYER_VOLUME); - + var lockPlayerVolume = SettingService.GetValue(SettingConstants.Player.LOCK_PLAYER_VOLUME, SettingConstants.Player.DEFAULT_LOCK_PLAYER_VOLUME); if (!lockPlayerVolume) { @@ -1588,7 +1588,7 @@ private async Task ChangeQualityPlayVideo(BiliPlayUrlInfo qual if (quality.PlayUrlType == BiliPlayUrlType.DASH) { var realPlayerType = (RealPlayerType)SettingService.GetValue(SettingConstants.Player.USE_REAL_PLAYER_TYPE, (int)SettingConstants.Player.DEFAULT_USE_REAL_PLAYER_TYPE); - if (realPlayerType==RealPlayerType.Native) + if (realPlayerType == RealPlayerType.Native) { result = await Player.PlayerDashUseNative(quality.DashInfo, quality.UserAgent, quality.Referer, positon: _postion); @@ -1681,10 +1681,6 @@ public void FullScreen(bool fullScreen) BottomBtnFull.Visibility = Visibility.Collapsed; BottomBtnFullWindows.Visibility = Visibility.Collapsed; BottomBtnExitFullWindows.Visibility = Visibility.Collapsed; - if (SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) > 0) - { - TopControlBar.Margin = new Thickness(0, 48, 0, 0); - } //全屏 if (!view.IsFullScreenMode) diff --git a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml index 3c7acc03..3980e383 100644 --- a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml +++ b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml @@ -337,6 +337,10 @@ + + + diff --git a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml.cs b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml.cs index 54b614a0..3be886e2 100644 --- a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml.cs +++ b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml.cs @@ -306,6 +306,16 @@ private void LoadUI() }; }; + // 标签高度 + NumTabHeight.Value = SettingService.GetValue(SettingConstants.UI.TAB_HEIGHT, SettingConstants.UI.DEFAULT_TAB_HEIGHT); + NumTabHeight.Loaded += (sender, e) => + { + NumTabHeight.ValueChanged += (obj, args) => + { + SettingService.SetValue(SettingConstants.UI.TAB_HEIGHT, NumTabHeight.Value); + }; + }; + //显示视频底部进度条 SwShowVideoBottomProgress.IsOn = SettingService.GetValue(SettingConstants.UI.SHOW_VIDEO_BOTTOM_VIRTUAL_PROGRESS_BAR, SettingConstants.UI.DEFAULT_SHOW_VIDEO_BOTTOM_VIRTUAL_PROGRESS_BAR); SwShowVideoBottomProgress.Loaded += (sender, e) => diff --git a/src/BiliLite.UWP/MainPage.xaml b/src/BiliLite.UWP/MainPage.xaml index 93d9dde9..4876fd6c 100644 --- a/src/BiliLite.UWP/MainPage.xaml +++ b/src/BiliLite.UWP/MainPage.xaml @@ -61,7 +61,6 @@ Visibility="Collapsed" /> diff --git a/src/BiliLite.UWP/MainPage.xaml.cs b/src/BiliLite.UWP/MainPage.xaml.cs index 15700688..af0ccc58 100644 --- a/src/BiliLite.UWP/MainPage.xaml.cs +++ b/src/BiliLite.UWP/MainPage.xaml.cs @@ -265,6 +265,9 @@ private void ClosePage(TabViewItem tabItem) } private void tabView_Loaded(object sender, RoutedEventArgs e) { + // 根据Tab高度设置图片视图边距 + gridViewer.Margin = new Thickness(0, m_viewModel.TabHeight, 0, 0); + var frame = new MyFrame(); frame.Navigate(typeof(HomePage)); @@ -325,9 +328,19 @@ private void InitTabViewStyle() var styleKvp = dict.FirstOrDefault(x => x.Key.ToString().Contains("TabViewItem")); - if (!(styleKvp.Value is Style style)) return; - style.Setters.Add(new Setter(TabViewItem.MinWidthProperty, m_viewModel.TabItemMinWidth)); - style.Setters.Add(new Setter(TabViewItem.MaxWidthProperty, m_viewModel.TabItemMaxWidth)); + if (styleKvp.Value is Style style) + { + style.Setters.Add(new Setter(TabViewItem.MinWidthProperty, m_viewModel.TabItemMinWidth)); + style.Setters.Add(new Setter(TabViewItem.MaxWidthProperty, m_viewModel.TabItemMaxWidth)); + style.Setters.Add(new Setter(TabViewItem.HeightProperty, m_viewModel.TabHeight)); + } + + var tabStyleKvp = dict.FirstOrDefault(x => x.Key.ToString().Contains("TabViewListView")); + + if (tabStyleKvp.Value is Style tabStyle) + { + tabStyle.Setters.Add(new Setter(TabViewItem.HeightProperty, m_viewModel.TabHeight)); + } } } } diff --git a/src/BiliLite.UWP/Models/Common/SettingConstants.cs b/src/BiliLite.UWP/Models/Common/SettingConstants.cs index b50e412a..68ebef35 100644 --- a/src/BiliLite.UWP/Models/Common/SettingConstants.cs +++ b/src/BiliLite.UWP/Models/Common/SettingConstants.cs @@ -235,6 +235,12 @@ public class UI [SettingDefaultValue] public const double DEFAULT_TAB_ITEM_MIN_WIDTH = 0; + [SettingKey(typeof(double))] + public const string TAB_HEIGHT = "TabHeight"; + + [SettingDefaultValue] + public const double DEFAULT_TAB_HEIGHT = 40; + /// /// 是否启用动态磁贴 /// diff --git a/src/BiliLite.UWP/Pages/LiveDetailPage.xaml.cs b/src/BiliLite.UWP/Pages/LiveDetailPage.xaml.cs index 4182d6a6..5c0f1045 100644 --- a/src/BiliLite.UWP/Pages/LiveDetailPage.xaml.cs +++ b/src/BiliLite.UWP/Pages/LiveDetailPage.xaml.cs @@ -323,10 +323,23 @@ await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => if (e.NewState.IsFullscreen && !view.IsFullScreenMode) { view.TryEnterFullScreenMode(); + + if (SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) <= 0) + { + var marginOffset = SettingService.GetValue(SettingConstants.UI.TAB_HEIGHT, + SettingConstants.UI.DEFAULT_TAB_HEIGHT); + this.Margin = new Thickness(0, marginOffset * -1, 0, 0); + } + else + { + this.Margin = new Thickness(0, -40, 0, 0); + } } else if (view.IsFullScreenMode) { view.ExitFullScreenMode(); + + this.Margin = new Thickness(0); } }); } diff --git a/src/BiliLite.UWP/Pages/SeasonDetailPage.xaml.cs b/src/BiliLite.UWP/Pages/SeasonDetailPage.xaml.cs index 43e6d95e..1fa7e166 100644 --- a/src/BiliLite.UWP/Pages/SeasonDetailPage.xaml.cs +++ b/src/BiliLite.UWP/Pages/SeasonDetailPage.xaml.cs @@ -275,7 +275,13 @@ private void PlayerControl_FullScreenEvent(object sender, bool e) { if (e) { - this.Margin = new Thickness(0, SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) == 0 ? -48 : -48, 0, 0); + if (SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) <= 0) + { + var marginOffset = SettingService.GetValue(SettingConstants.UI.TAB_HEIGHT, + SettingConstants.UI.DEFAULT_TAB_HEIGHT); + this.Margin = new Thickness(0, marginOffset * -1, 0, 0); + } + m_viewModel.DefaultRightInfoWidth = new GridLength(0, GridUnitType.Pixel); BottomInfo.Height = new GridLength(0, GridUnitType.Pixel); } diff --git a/src/BiliLite.UWP/Pages/VideoDetailPage.xaml.cs b/src/BiliLite.UWP/Pages/VideoDetailPage.xaml.cs index ae203c4d..b7029014 100644 --- a/src/BiliLite.UWP/Pages/VideoDetailPage.xaml.cs +++ b/src/BiliLite.UWP/Pages/VideoDetailPage.xaml.cs @@ -449,14 +449,21 @@ private void PlayerControl_FullScreenEvent(object sender, bool e) { if (e) { - this.Margin = new Thickness(0, SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) == 0 ? -48 : -48, 0, 0); + if (SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) <= 0) + { + var marginOffset = SettingService.GetValue(SettingConstants.UI.TAB_HEIGHT, + SettingConstants.UI.DEFAULT_TAB_HEIGHT); + this.Margin = new Thickness(0, marginOffset * -1, 0, 0); + } + m_viewModel.DefaultRightInfoWidth = new GridLength(0, GridUnitType.Pixel); BottomInfo.Height = new GridLength(0, GridUnitType.Pixel); } else { this.Margin = new Thickness(0); - m_viewModel.DefaultRightInfoWidth = new GridLength(SettingService.GetValue(SettingConstants.UI.RIGHT_DETAIL_WIDTH, 320), GridUnitType.Pixel); + m_viewModel.DefaultRightInfoWidth = new GridLength( + SettingService.GetValue(SettingConstants.UI.RIGHT_DETAIL_WIDTH, 320), GridUnitType.Pixel); BottomInfo.Height = GridLength.Auto; } } diff --git a/src/BiliLite.UWP/Services/FrostMasterDanmakuController.cs b/src/BiliLite.UWP/Services/FrostMasterDanmakuController.cs index 6e2eb235..5339ac4d 100644 --- a/src/BiliLite.UWP/Services/FrostMasterDanmakuController.cs +++ b/src/BiliLite.UWP/Services/FrostMasterDanmakuController.cs @@ -6,7 +6,6 @@ using Windows.UI.Xaml.Controls; using Atelier39; using AutoMapper; -using BiliLite.Models.Common; using BiliLite.Models.Common.Danmaku; using BiliLite.Services.Interfaces; using BiliLite.ViewModels.Video; @@ -115,23 +114,7 @@ public override void SetSpeed(int speed) public override void SetTopMargin(double topMargin) { base.SetTopMargin(topMargin); - if (SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) > 0) - { - m_danmakuCanvas.Margin = DanmakuViewModel.Fullscreen ? new Thickness(0, DanmakuViewModel.MarginTop + 16, 0, 0) : new Thickness(0, DanmakuViewModel.MarginTop, 0, 0); - } - else - { - m_danmakuCanvas.Margin = new Thickness(0, topMargin, 0, 0); - } - } - - public override void SetFullscreen(bool fullscreen) - { - base.SetFullscreen(fullscreen); - if (SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) > 0) - { - m_danmakuCanvas.Margin = fullscreen ? new Thickness(0, DanmakuViewModel.MarginTop + 16, 0, 0) : new Thickness(0, DanmakuViewModel.MarginTop, 0, 0); - } + m_danmakuCanvas.Margin = new Thickness(0, topMargin, 0, 0); } public override void SetOpacity(double opacity) diff --git a/src/BiliLite.UWP/Services/NsDanmakuController.cs b/src/BiliLite.UWP/Services/NsDanmakuController.cs index bb72e099..615210e2 100644 --- a/src/BiliLite.UWP/Services/NsDanmakuController.cs +++ b/src/BiliLite.UWP/Services/NsDanmakuController.cs @@ -12,7 +12,6 @@ using BiliLite.ViewModels.Video; using NSDanmaku.Controls; using NSDanmaku.Model; -using BiliLite.Models.Common; namespace BiliLite.Services { @@ -112,23 +111,7 @@ public override void SetSpeed(int speed) public override void SetTopMargin(double topMargin) { base.SetTopMargin(topMargin); - if (SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) > 0) - { - m_danmakuControl.Margin = DanmakuViewModel.Fullscreen ? new Thickness(0, DanmakuViewModel.MarginTop + 16, 0, 0) : new Thickness(0, DanmakuViewModel.MarginTop, 0, 0); - } - else - { - m_danmakuControl.Margin = new Thickness(0, topMargin, 0, 0); - } - } - - public override void SetFullscreen(bool fullscreen) - { - base.SetFullscreen(fullscreen); - if (SettingService.GetValue(SettingConstants.UI.DISPLAY_MODE, 0) > 0) - { - m_danmakuControl.Margin = fullscreen ? new Thickness(0, DanmakuViewModel.MarginTop + 16, 0, 0) : new Thickness(0, DanmakuViewModel.MarginTop, 0, 0); - } + m_danmakuControl.Margin = new Thickness(0, topMargin, 0, 0); } public override void SetOpacity(double opacity) diff --git a/src/BiliLite.UWP/Styles/TabViewStyle.xaml b/src/BiliLite.UWP/Styles/TabViewStyle.xaml index 69360f79..3dbff8f2 100644 --- a/src/BiliLite.UWP/Styles/TabViewStyle.xaml +++ b/src/BiliLite.UWP/Styles/TabViewStyle.xaml @@ -20,7 +20,7 @@ - + diff --git a/src/BiliLite.UWP/ViewModels/Common/MainPageViewModel.cs b/src/BiliLite.UWP/ViewModels/Common/MainPageViewModel.cs index 21741414..3a391917 100644 --- a/src/BiliLite.UWP/ViewModels/Common/MainPageViewModel.cs +++ b/src/BiliLite.UWP/ViewModels/Common/MainPageViewModel.cs @@ -32,5 +32,10 @@ public class MainPageViewModel : BaseViewModel : SettingService.GetValue( SettingConstants.UI.TAB_ITEM_MIN_WIDTH, SettingConstants.UI.DEFAULT_TAB_ITEM_MIN_WIDTH); + + [DoNotNotify] + public double TabHeight => SettingService.GetValue( + SettingConstants.UI.TAB_HEIGHT, + SettingConstants.UI.DEFAULT_TAB_HEIGHT); } } From a2d221ad035bd6f75a86a0cf44b2388b192415c8 Mon Sep 17 00:00:00 2001 From: ywmoyue Date: Tue, 17 Dec 2024 18:21:42 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=9C=80=E5=B0=8F=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controls/Settings/UISettingsControl.xaml | 8 ++++++++ .../Settings/UISettingsControl.xaml.cs | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml index 3980e383..f92a96a8 100644 --- a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml +++ b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml @@ -341,6 +341,14 @@ Description="设置标签页高度(下次打开应用生效,建议立即重启应用,否则会出现奇怪的bug)"> + + + + + + diff --git a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml.cs b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml.cs index 3be886e2..dd8fc806 100644 --- a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml.cs +++ b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml.cs @@ -306,6 +306,26 @@ private void LoadUI() }; }; + // 标签最小宽度 + NumTabItemMinWidth.Value = SettingService.GetValue(SettingConstants.UI.TAB_ITEM_MIN_WIDTH, SettingConstants.UI.DEFAULT_TAB_ITEM_MIN_WIDTH); + NumTabItemMinWidth.Loaded += (sender, e) => + { + NumTabItemMinWidth.ValueChanged += (obj, args) => + { + SettingService.SetValue(SettingConstants.UI.TAB_ITEM_MIN_WIDTH, NumTabItemMinWidth.Value); + }; + }; + + // 标签最大宽度 + NumTabItemMaxWidth.Value = SettingService.GetValue(SettingConstants.UI.TAB_ITEM_MAX_WIDTH, SettingConstants.UI.DEFAULT_TAB_ITEM_MAX_WIDTH); + NumTabItemMaxWidth.Loaded += (sender, e) => + { + NumTabItemMaxWidth.ValueChanged += (obj, args) => + { + SettingService.SetValue(SettingConstants.UI.TAB_ITEM_MAX_WIDTH, NumTabItemMaxWidth.Value); + }; + }; + // 标签高度 NumTabHeight.Value = SettingService.GetValue(SettingConstants.UI.TAB_HEIGHT, SettingConstants.UI.DEFAULT_TAB_HEIGHT); NumTabHeight.Loaded += (sender, e) => From 57cd874eb4536f748547e7b9259590f9cf447e94 Mon Sep 17 00:00:00 2001 From: ProJend Date: Tue, 17 Dec 2024 21:59:52 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E8=AE=BE=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.UWP/BiliLite.UWP.csproj | 1 + .../Controls/Settings/UISettingsControl.xaml | 22 +++++++++---------- .../Converters/InverseBooleanConverter.cs | 12 ++++++++++ src/BiliLite.UWP/Styles/Converter.xaml | 1 + 4 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 src/BiliLite.UWP/Converters/InverseBooleanConverter.cs diff --git a/src/BiliLite.UWP/BiliLite.UWP.csproj b/src/BiliLite.UWP/BiliLite.UWP.csproj index 755fd1b5..05028001 100644 --- a/src/BiliLite.UWP/BiliLite.UWP.csproj +++ b/src/BiliLite.UWP/BiliLite.UWP.csproj @@ -186,6 +186,7 @@ VideoListView.xaml + EditPlaySpeedMenuDialog.xaml diff --git a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml index f92a96a8..68daec49 100644 --- a/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml +++ b/src/BiliLite.UWP/Controls/Settings/UISettingsControl.xaml @@ -330,24 +330,24 @@ - + - - + + - - + + - - + + diff --git a/src/BiliLite.UWP/Converters/InverseBooleanConverter.cs b/src/BiliLite.UWP/Converters/InverseBooleanConverter.cs new file mode 100644 index 00000000..3a63bea4 --- /dev/null +++ b/src/BiliLite.UWP/Converters/InverseBooleanConverter.cs @@ -0,0 +1,12 @@ +using System; +using Windows.UI.Xaml.Data; + +namespace BiliLite.Converters +{ + public class InverseBooleanConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) => !(bool)value; + + public object ConvertBack(object value, Type targetType, object parameter, string language) => throw new NotImplementedException(); + } +} diff --git a/src/BiliLite.UWP/Styles/Converter.xaml b/src/BiliLite.UWP/Styles/Converter.xaml index 49b1fe3c..e07280f5 100644 --- a/src/BiliLite.UWP/Styles/Converter.xaml +++ b/src/BiliLite.UWP/Styles/Converter.xaml @@ -8,4 +8,5 @@ + From 2c14f4b2ebd74c6acda709b84bfc7222affe78eb Mon Sep 17 00:00:00 2001 From: ProJend Date: Tue, 17 Dec 2024 22:09:44 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E8=83=8C=E6=99=AF=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BiliLite.UWP/Styles/TabViewStyle.xaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BiliLite.UWP/Styles/TabViewStyle.xaml b/src/BiliLite.UWP/Styles/TabViewStyle.xaml index 3dbff8f2..4abc4796 100644 --- a/src/BiliLite.UWP/Styles/TabViewStyle.xaml +++ b/src/BiliLite.UWP/Styles/TabViewStyle.xaml @@ -68,8 +68,8 @@