Skip to content

Commit

Permalink
feat: 添加title icon
Browse files Browse the repository at this point in the history
  • Loading branch information
K12f committed Sep 19, 2024
1 parent bf14fd2 commit e47c0eb
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 118 deletions.
168 changes: 85 additions & 83 deletions src/BlueCatKoKo.Ui/BlueCatKoKo.Ui.csproj
Original file line number Diff line number Diff line change
@@ -1,94 +1,96 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>applicationIcon.ico</ApplicationIcon>
<Platforms>AnyCPU;x64</Platforms>
<UseWPF>true</UseWPF>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>applicationIcon.ico</ApplicationIcon>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>BetterGI</AssemblyName>
<AssemblyVersion>1.2.5</AssemblyVersion>
<UseWPF>true</UseWPF>

<BeautySharedRuntimeMode>False</BeautySharedRuntimeMode>
<!-- beauty into sub-directory, default is libs, quote with "" if contains space -->
<BeautyLibsDir Condition="$(BeautySharedRuntimeMode) == 'True'">../libraries</BeautyLibsDir>
<BeautyLibsDir Condition="$(BeautySharedRuntimeMode) != 'True'">./libraries</BeautyLibsDir>
<!-- dlls that you don't want to be moved or can not be moved -->
<!-- <BeautyExcludes>dll1.dll;lib*;...</BeautyExcludes> -->
<!-- dlls that end users never needed, so hide them -->
<!-- <BeautyHiddens>hostfxr;hostpolicy;*.deps.json;*.runtimeconfig*.json</BeautyHiddens> -->
<!-- set to True if you want to disable -->
<DisableBeauty>False</DisableBeauty>
<!-- set to False if you want to beauty on build -->
<BeautyOnPublishOnly>False</BeautyOnPublishOnly>
<!-- DO NOT TOUCH THIS OPTION -->
<BeautyNoRuntimeInfo>False</BeautyNoRuntimeInfo>
<!-- set to True if you want to allow 3rd debuggers(like dnSpy) debugs the app -->
<BeautyEnableDebugging>False</BeautyEnableDebugging>
<!-- the patch can reduce the file count -->
<!-- set to False if you want to disable -->
<!-- SCD Mode Feature Only -->
<BeautyUsePatch>True</BeautyUsePatch>
<!-- App Entry Dll = BeautyDir + BeautyAppHostDir + BeautyAppHostEntry -->
<!-- see https://github.com/nulastudio/NetBeauty2#customize-apphost for more details -->
<!-- relative path based on AppHostDir -->
<!-- .NET Core Non Single-File Only -->
<!-- <BeautyAppHostEntry>bin/MyApp.dll</BeautyAppHostEntry> -->
<!-- relative path based on BeautyDir -->
<!-- .NET Core Non Single-File Only -->
<!-- <BeautyAppHostDir>..</BeautyAppHostDir> -->
<!-- <BeautyAfterTasks></BeautyAfterTasks> -->
<!-- valid values: Error|Detail|Info -->
<BeautyLogLevel>Info</BeautyLogLevel>
<!-- set to a repo mirror if you have troble in connecting github -->
<!-- <BeautyGitCDN>https://gitee.com/liesauer/HostFXRPatcher</BeautyGitCDN> -->
<!-- <BeautyGitTree>master</BeautyGitTree> -->
</PropertyGroup>
<BeautySharedRuntimeMode>False</BeautySharedRuntimeMode>
<!-- beauty into sub-directory, default is libs, quote with "" if contains space -->
<BeautyLibsDir Condition="$(BeautySharedRuntimeMode) == 'True'">../libraries</BeautyLibsDir>
<BeautyLibsDir Condition="$(BeautySharedRuntimeMode) != 'True'">./libraries</BeautyLibsDir>
<!-- dlls that you don't want to be moved or can not be moved -->
<!-- <BeautyExcludes>dll1.dll;lib*;...</BeautyExcludes> -->
<!-- dlls that end users never needed, so hide them -->
<!-- <BeautyHiddens>hostfxr;hostpolicy;*.deps.json;*.runtimeconfig*.json</BeautyHiddens> -->
<!-- set to True if you want to disable -->
<DisableBeauty>False</DisableBeauty>
<!-- set to False if you want to beauty on build -->
<BeautyOnPublishOnly>False</BeautyOnPublishOnly>
<!-- DO NOT TOUCH THIS OPTION -->
<BeautyNoRuntimeInfo>False</BeautyNoRuntimeInfo>
<!-- set to True if you want to allow 3rd debuggers(like dnSpy) debugs the app -->
<BeautyEnableDebugging>False</BeautyEnableDebugging>
<!-- the patch can reduce the file count -->
<!-- set to False if you want to disable -->
<!-- SCD Mode Feature Only -->
<BeautyUsePatch>True</BeautyUsePatch>
<!-- App Entry Dll = BeautyDir + BeautyAppHostDir + BeautyAppHostEntry -->
<!-- see https://github.com/nulastudio/NetBeauty2#customize-apphost for more details -->
<!-- relative path based on AppHostDir -->
<!-- .NET Core Non Single-File Only -->
<!-- <BeautyAppHostEntry>bin/MyApp.dll</BeautyAppHostEntry> -->
<!-- relative path based on BeautyDir -->
<!-- .NET Core Non Single-File Only -->
<!-- <BeautyAppHostDir>..</BeautyAppHostDir> -->
<!-- <BeautyAfterTasks></BeautyAfterTasks> -->
<!-- valid values: Error|Detail|Info -->
<BeautyLogLevel>Info</BeautyLogLevel>
<!-- set to a repo mirror if you have troble in connecting github -->
<!-- <BeautyGitCDN>https://gitee.com/liesauer/HostFXRPatcher</BeautyGitCDN> -->
<!-- <BeautyGitTree>master</BeautyGitTree> -->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2"/>
<PackageReference Include="Downloader" Version="3.1.2"/>
<PackageReference Include="HandyControl" Version="3.5.1"/>
<PackageReference Include="LibVLCSharp.WPF" Version="3.9.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.5"/>
<PackageReference Include="RestSharp" Version="111.4.1"/>
<PackageReference Include="Serilog" Version="4.0.1"/>
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0"/>
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0"/>
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0"/>
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.20"/>
<PackageReference Include="WPF-UI" Version="3.0.5"/>
<PackageReference Include="WPF-UI.Tray" Version="3.0.5"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2"/>
<PackageReference Include="Downloader" Version="3.1.2"/>
<PackageReference Include="HandyControl" Version="3.5.1"/>
<PackageReference Include="LibVLCSharp.WPF" Version="3.9.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.5"/>
<PackageReference Include="RestSharp" Version="111.4.1"/>
<PackageReference Include="Serilog" Version="4.0.1"/>
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0"/>
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0"/>
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0"/>
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.20"/>
<PackageReference Include="WPF-UI" Version="3.0.5"/>
<PackageReference Include="WPF-UI.Tray" Version="3.0.5"/>
</ItemGroup>

<PropertyGroup>
<AssemblyName>BlueCatKoKo</AssemblyName>
</PropertyGroup>
<PropertyGroup>
<AssemblyName>BlueCatKoKo</AssemblyName>
</PropertyGroup>

<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<None Include="$(ProjectDir)Assets\**"
CopyToOutputDirectory="PreserveNewest"
LinkBase="Assets\"/>
</ItemGroup>
<ItemGroup>
<None Include="$(ProjectDir)Assets\**"
CopyToOutputDirectory="PreserveNewest"
LinkBase="Assets\"/>
</ItemGroup>

<ItemGroup>
<None Remove="applicationicon.ico"/>
<Resource Include="applicationicon.ico" />
</ItemGroup>
<ItemGroup>
<None Remove="applicationicon.ico"/>
<Resource Include="applicationicon.ico"/>
</ItemGroup>

<ItemGroup>
<None Remove="Assets\applicationicon.jpg"/>
<Resource Include="Assets\applicationicon.jpg"/>
</ItemGroup>
<ItemGroup>
<None Remove="Assets\applicationicon.jpg"/>
<Resource Include="Assets\applicationicon.jpg"/>
</ItemGroup>

</Project>
71 changes: 37 additions & 34 deletions src/BlueCatKoKo.Ui/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,44 @@
Height="768"
d:DesignHeight="768"
d:DesignWidth="1366">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<ui:NavigationView
x:Name="RootNavigation"
Grid.Row="1"
IsBackButtonVisible="Collapsed"
IsPaneToggleVisible="True"
OpenPaneLength="150"
FooterMenuItemsSource="{Binding ViewModel.NavigationFooter, Mode=OneWay}"
MenuItemsSource="{Binding ViewModel.NavigationItems, Mode=OneWay}">
<ui:NavigationView.Header>
<ui:BreadcrumbBar
Margin="42,32,0,0"
FontSize="28"
FontWeight="DemiBold" />
</ui:NavigationView.Header>
</ui:NavigationView>
<ui:TitleBar
Title="{Binding ViewModel.ApplicationTitle, Mode=OneWay}"
Grid.Row="0"
Icon="/applicationicon.ico" />
<ui:NavigationView
x:Name="RootNavigation"
Grid.Row="1"
IsBackButtonVisible="Collapsed"
IsPaneToggleVisible="True"
OpenPaneLength="150"
FooterMenuItemsSource="{Binding ViewModel.NavigationFooter, Mode=OneWay}"
MenuItemsSource="{Binding ViewModel.NavigationItems, Mode=OneWay}">
<ui:NavigationView.Header>
<ui:BreadcrumbBar
Margin="42,32,0,0"
FontSize="28"
FontWeight="DemiBold" />
</ui:NavigationView.Header>
</ui:NavigationView>
<ui:TitleBar
Title="{Binding ViewModel.ApplicationTitle, Mode=OneWay}"
Grid.Row="0">
<ui:TitleBar.Icon>
<ui:ImageIcon Source="pack://application:,,,/applicationicon.ico" />
</ui:TitleBar.Icon>
</ui:TitleBar>

<hc:NotifyIcon Grid.Row="0" Text="{Binding ViewModel.ApplicationTitle}" IsBlink="False" Visibility="Visible"
Icon="/Assets/applicationicon.jpg">
<hc:NotifyIcon.ContextMenu>
<ContextMenu>
<MenuItem Command="hc:ControlCommands.PushMainWindow2Top" Header="首页" />
<MenuItem Command="hc:ControlCommands.ShutdownApp" Header="退出" />
</ContextMenu>
</hc:NotifyIcon.ContextMenu>
</hc:NotifyIcon>
<hc:NotifyIcon Grid.Row="0" Text="{Binding ViewModel.ApplicationTitle}" IsBlink="False" Visibility="Visible"
Icon="/Assets/applicationicon.jpg">
<hc:NotifyIcon.ContextMenu>
<ContextMenu>
<MenuItem Command="hc:ControlCommands.PushMainWindow2Top" Header="首页" />
<MenuItem Command="hc:ControlCommands.ShutdownApp" Header="退出" />
</ContextMenu>
</hc:NotifyIcon.ContextMenu>
</hc:NotifyIcon>

</Grid>
</Grid>
</ui:FluentWindow>
2 changes: 1 addition & 1 deletion src/BlueCatKoKo.Ui/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"AppConfig": {
"Name": "BlueCatKoKo",
"TrayTitle": "BlueCatKoKo-DY-Downloader",
"Version": "v1.2.4",
"Version": "v1.2.5",
"Description": "BlueCatKoKo is a Douyin Downloader",
"DownloadPath": "./",
"RepositoryUrl": "https://github.com/K12f/BlueCatKoKo",
Expand Down

0 comments on commit e47c0eb

Please sign in to comment.