Skip to content

Commit

Permalink
更新引用,去除标题栏运行平台标识 (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy authored Dec 28, 2024
1 parent 43154a3 commit 9f4514d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 53 deletions.
48 changes: 0 additions & 48 deletions src/Desktop/BiliCopilot.UI/Controls/RootLayout.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

using BiliCopilot.UI.Models.Constants;
using BiliCopilot.UI.Pages.Overlay;
using BiliCopilot.UI.Toolkits;
using BiliCopilot.UI.ViewModels.Core;
using Richasy.WinUI.Share.Base;
using Richasy.WinUI.Share.ViewModels;
Expand All @@ -23,7 +22,6 @@ public RootLayout()
{
InitializeComponent();
_appViewModel = this.Get<AppViewModel>();
InitializeSubtitle();
}

/// <inheritdoc/>
Expand Down Expand Up @@ -234,7 +232,6 @@ public bool TryCancelRightArrow()
protected override void OnControlLoaded()
{
ViewModel.Initialize(MainFrame, OverlayFrame);
ViewModel.PropertyChanged += OnViewModelPropertyChanged;
var selectedItem = ViewModel.MenuItems.FirstOrDefault(p => p.IsSelected);
if (selectedItem is not null)
{
Expand All @@ -243,51 +240,6 @@ protected override void OnControlLoaded()
}
}

/// <inheritdoc/>
protected override void OnControlUnloaded()
=> ViewModel.PropertyChanged -= OnViewModelPropertyChanged;

private void OnViewModelPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(ViewModel.IsTopNavBarShown))
{
InitializeSubtitle();
}
}

private void InitializeSubtitle()
{
var isTopNavBarShown = SettingsToolkit.ReadLocalSetting(Models.Constants.SettingNames.IsTopNavBarShown, true);
if (isTopNavBarShown)
{
MainTitleBar.Subtitle = string.Empty;
return;
}

#if LOCAL_DEV
var subtitles = new List<string>();
subtitles.Add("🛠️");
#if DEBUG
subtitles.Add("Debug");
#else
subtitles.Add("Release");
#endif
#if ARCH_X64
subtitles.Add("x64");
#elif ARCH_X86
subtitles.Add("x86");
#elif ARCH_ARM64
subtitles.Add("ARM64");
#endif
if (subtitles.Count > 0)
{
MainTitleBar.Subtitle = string.Join(" | ", subtitles);
}
#else
_ = this;
#endif
}

private void OnNavViewBackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
=> OnBackRequested(default, default);

Expand Down
8 changes: 4 additions & 4 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.241112-preview1" />
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.0.240109" />
<PackageVersion Include="CommunityToolkit.WinUI.Media" Version="8.0.240109" />
<PackageVersion Include="ComputeSharp.D2D1.WinUI" Version="3.1.0-preview2" />
<PackageVersion Include="FluentIcons.WinUI" Version="1.1.266" />
<PackageVersion Include="ComputeSharp.D2D1.WinUI" Version="3.1.0" />
<PackageVersion Include="FluentIcons.WinUI" Version="1.1.271" />
<PackageVersion Include="Flurl.Http" Version="4.0.2" />
<PackageVersion Include="Google.Protobuf" Version="3.27.2" />
<PackageVersion Include="Grpc.Net.Client" Version="2.63.0" />
<PackageVersion Include="Grpc.Tools" Version="2.64.0" />
<PackageVersion Include="H.NotifyIcon.WinUI" Version="2.2.0" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.71" />
<PackageVersion Include="Humanizer.Core.zh-Hans" Version="2.14.1" />
<PackageVersion Include="Markdig" Version="0.38.0" />
<PackageVersion Include="Markdig" Version="0.39.1" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0" />
<PackageVersion Include="Microsoft.Bcl.Numerics" Version="9.0.0" />
Expand Down Expand Up @@ -54,7 +54,7 @@
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="Microsoft.Graphics.Win2D" Version="1.3.0" />
<PackageVersion Include="Microsoft.Graphics.Win2D" Version="1.3.1" />
<!-- Microsoft.Extensions.* -->
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/Libs/WinUI.Share

0 comments on commit 9f4514d

Please sign in to comment.