fix(SymbolIcon):修复SymbolIcon问题并修改打包过程以正确构建单文件程序 (#407)

* refactor(Icon): 将SymbolIcon替换为FontIcon以使用Segoe Fluent Icons

Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com>

* chore: 移除 Costura.Fody 的 IncludeAssets 配置

Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com>

---------

Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com>
This commit is contained in:
doudou0720
2026-03-21 22:15:36 +08:00
committed by GitHub
parent 016abafee4
commit 3ae99c82cc
11 changed files with 44 additions and 41 deletions
-1
View File
@@ -147,7 +147,6 @@
<ItemGroup>
<PackageReference Include="Costura.Fody" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="2.0.1" />
<PackageReference Include="iNKORE.UI.WPF.Modern" Version="0.10.2.1" />
+7 -7
View File
@@ -5141,7 +5141,7 @@
Click="WhiteBoardPageListItem_DeleteClick"
Background="#CC000000" Foreground="White"
BorderThickness="0" Padding="0" Cursor="Hand">
<ui:SymbolIcon Symbol="Delete" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Delete}" />
</Button>
</Grid>
</Border>
@@ -6633,7 +6633,7 @@
<Run Text="{i18n:I18n Key=Board_Shape}" />
<Run Text="{i18n:I18n Key=Board_ShapeHintLongPress}" FontSize="10" />
</TextBlock>
<ui:SymbolIcon Margin="0,-20,8,15" Symbol="Pin"
<ui:FontIcon Margin="0,-20,8,15" Icon="{x:Static ui:SegoeFluentIcons.Pin}"
MouseDown="Border_MouseDown"
MouseUp="SymbolIconPinBorderDrawShape_MouseUp"
Foreground="{DynamicResource FloatBarForeground}"
@@ -7318,7 +7318,7 @@
Click="WhiteBoardPageListItem_DeleteClick"
Background="#CC000000" Foreground="White"
BorderThickness="0" Padding="0" Cursor="Hand">
<ui:SymbolIcon Symbol="Delete" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Delete}" />
</Button>
</Grid>
</Border>
@@ -7370,7 +7370,7 @@
Width="50" Height="48" FontSize="26" Click="BtnWhiteBoardAdd_Click"
Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}">
<ui:SymbolIcon Symbol="Add" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Add}" />
</Button>
<Button Name="BtnWhiteBoardSwitchPrevious" FontFamily="Symbol"
Width="50" Height="48" FontSize="25" Click="BtnWhiteBoardSwitchPrevious_Click"
@@ -7443,7 +7443,7 @@
Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}"
IsEnabled="False">
<ui:SymbolIcon Symbol="Delete" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Delete}" />
</Button>
</ikw:SimpleStackPanel>
</Grid>
@@ -7557,7 +7557,7 @@
Background="{Binding ElementName=BtnExit, Path=Background}"
IsEnabled="False" Visibility="Collapsed" IsEnabledChanged="Btn_IsEnabledChanged">
<StackPanel Opacity="0.2">
<ui:SymbolIcon Symbol="Undo" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Undo}" />
<TextBlock Text="{i18n:I18n Key=Board_Undo}" Margin="0,4,0,0" />
</StackPanel>
</Button>
@@ -7567,7 +7567,7 @@
Background="{Binding ElementName=BtnExit, Path=Background}"
IsEnabled="False" Visibility="Collapsed" IsEnabledChanged="Btn_IsEnabledChanged">
<StackPanel Opacity="0.2">
<ui:SymbolIcon Symbol="Redo" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Redo}" />
<TextBlock Text="{i18n:I18n Key=OldUI_Restore}" Margin="0,4,0,0" />
</StackPanel>
</Button>
+3 -2
View File
@@ -1,5 +1,6 @@
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -113,9 +114,9 @@ namespace Ink_Canvas
ToggleSwitchDrawShapeBorderAutoHide.IsOn = !ToggleSwitchDrawShapeBorderAutoHide.IsOn;
if (ToggleSwitchDrawShapeBorderAutoHide.IsOn)
((SymbolIcon)sender).Symbol = Symbol.Pin;
((FontIcon)sender).Icon = SegoeFluentIcons.Pin;
else
((SymbolIcon)sender).Symbol = Symbol.UnPin;
((FontIcon)sender).Icon = SegoeFluentIcons.Unpin;
}
/// <summary>
+9 -9
View File
@@ -1,4 +1,4 @@
<Window x:Class="Ink_Canvas.CountdownTimerWindow"
<Window x:Class="Ink_Canvas.CountdownTimerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -116,7 +116,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Symbol="Save" Foreground="White"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Save}" Foreground="White"/>
</Viewbox>
</Border>
</Grid>
@@ -181,12 +181,12 @@
<Grid>
<Border x:Name="BtnStart" MouseUp="BtnStart_MouseUp" Background="{DynamicResource TimerWindowPrimaryButtonBackground}" Height="20" Width="20" CornerRadius="100">
<Viewbox Margin="5">
<ui:SymbolIcon Name="SymbolIconStart" Symbol="Play" Foreground="White"/>
<ui:FontIcon Name="FontIconStart" Icon="{x:Static ui:SegoeFluentIcons.Play}" Foreground="White"/>
</Viewbox>
</Border>
<Border x:Name="BtnStartCover" Visibility="Collapsed" Background="#BFBFBF" Height="20" Width="20" CornerRadius="100">
<Viewbox Margin="5">
<ui:SymbolIcon Symbol="{Binding ElementName=SymbolIconStart, Path=Symbol}" Foreground="White"/>
<ui:FontIcon Icon="{Binding ElementName=FontIconStart, Path=Icon}" Foreground="White"/>
</Viewbox>
</Border>
</Grid>
@@ -196,12 +196,12 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.15" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Symbol="Refresh" Foreground="{DynamicResource TimerWindowButtonForeground}"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Refresh}" Foreground="{DynamicResource TimerWindowButtonForeground}"/>
</Viewbox>
</Border>
<Border x:Name="BtnResetCover" Background="#F3F5F9" Height="20" Width="20" CornerRadius="100">
<Viewbox Margin="5.5">
<ui:SymbolIcon Symbol="Refresh" Foreground="#9D9D9E"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Refresh}" Foreground="#9D9D9E"/>
</Viewbox>
</Border>
</Grid>
@@ -217,7 +217,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Name="SymbolIconMinimal" Symbol="HideBcc" Foreground="{DynamicResource TimerWindowButtonForeground}"/>
<ui:FontIcon Name="FontIconMinimal" Icon="{x:Static ui:SegoeFluentIcons.HideBcc}" Foreground="{DynamicResource TimerWindowButtonForeground}"/>
</Viewbox>
</Border>
<Border x:Name="BtnFullscreen" MouseUp="BtnFullscreen_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
@@ -227,7 +227,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Name="SymbolIconFullscreen" Symbol="FullScreen" Foreground="{DynamicResource TimerWindowButtonForeground}"/>
<ui:FontIcon Name="FontIconFullscreen" Icon="{x:Static ui:SegoeFluentIcons.FullScreen}" Foreground="{DynamicResource TimerWindowButtonForeground}"/>
</Viewbox>
</Border>
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
@@ -237,7 +237,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Symbol="Clear" Foreground="White"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Clear}" Foreground="White"/>
</Viewbox>
</Border>
</ikw:SimpleStackPanel>
@@ -1,4 +1,5 @@
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using System;
using System.Media;
using System.Timers;
@@ -75,7 +76,7 @@ namespace Ink_Canvas
TextBlockSecond.Text = "00";
timer.Stop();
isTimerRunning = false;
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play;
FontIconStart.Icon = SegoeFluentIcons.Play;
BtnStartCover.Visibility = Visibility.Visible;
var textForeground = Application.Current.FindResource("TimerWindowTextForeground") as SolidColorBrush;
if (textForeground != null)
@@ -264,12 +265,12 @@ namespace Ink_Canvas
if (WindowState == WindowState.Normal)
{
WindowState = WindowState.Maximized;
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.BackToWindow;
FontIconFullscreen.Icon = SegoeFluentIcons.BackToWindow;
}
else
{
WindowState = WindowState.Normal;
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.FullScreen;
FontIconFullscreen.Icon = SegoeFluentIcons.FullScreen;
}
}
@@ -305,7 +306,7 @@ namespace Ink_Canvas
TextBlockHour.Foreground = textForeground3;
else
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play;
FontIconStart.Icon = SegoeFluentIcons.Play;
isTimerRunning = false;
timer.Stop();
isPaused = false;
@@ -362,7 +363,7 @@ namespace Ink_Canvas
TextBlockHour.Foreground = textForeground1;
else
TextBlockHour.Foreground = Brushes.Black;
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Pause;
FontIconStart.Icon = SegoeFluentIcons.Pause;
isPaused = false;
timer.Start();
UpdateStopTime();
@@ -378,7 +379,7 @@ namespace Ink_Canvas
TextBlockHour.Foreground = textForeground3;
else
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play;
FontIconStart.Icon = SegoeFluentIcons.Play;
BorderStopTime.Visibility = Visibility.Collapsed;
isPaused = true;
timer.Stop();
@@ -394,7 +395,7 @@ namespace Ink_Canvas
TextBlockHour.Foreground = textForeground2;
else
TextBlockHour.Foreground = Brushes.Black;
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Pause;
FontIconStart.Icon = SegoeFluentIcons.Pause;
BtnResetCover.Visibility = Visibility.Collapsed;
if (totalSeconds <= 10)
@@ -33,7 +33,7 @@
<!-- 标题区域 -->
<ikw:SimpleStackPanel Grid.Row="0" Orientation="Horizontal" Spacing="12" Margin="0,0,0,16">
<Border Background="{DynamicResource PrimaryBrush}" CornerRadius="16" Padding="12" Margin="0,0,0,0">
<ui:SymbolIcon Symbol="Undo" FontSize="20" Foreground="White"
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Undo}" FontSize="20" Foreground="White"
VerticalAlignment="Center"/>
</Border>
<ikw:SimpleStackPanel VerticalAlignment="Center" Spacing="4">
+3 -3
View File
@@ -1,4 +1,4 @@
<Window x:Class="Ink_Canvas.OperatingGuideWindow"
<Window x:Class="Ink_Canvas.OperatingGuideWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -81,7 +81,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Name="SymbolIconFullscreen" Symbol="FullScreen" Foreground="{DynamicResource OperatingGuideWindowFullscreenButtonForeground}"/>
<ui:FontIcon Name="FontIconFullscreen" Icon="{x:Static ui:SegoeFluentIcons.FullScreen}" Foreground="{DynamicResource OperatingGuideWindowFullscreenButtonForeground}"/>
</Viewbox>
</Border>
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
@@ -91,7 +91,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="5.5">
<ui:SymbolIcon Symbol="Clear" Foreground="{DynamicResource OperatingGuideWindowCloseButtonForeground}"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Clear}" Foreground="{DynamicResource OperatingGuideWindowCloseButtonForeground}"/>
</Viewbox>
</Border>
</ikw:SimpleStackPanel>
@@ -1,5 +1,6 @@
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using System;
using System.Windows;
using System.Windows.Input;
@@ -32,12 +33,12 @@ namespace Ink_Canvas
if (WindowState == WindowState.Normal)
{
WindowState = WindowState.Maximized;
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.BackToWindow;
FontIconFullscreen.Icon = SegoeFluentIcons.BackToWindow;
}
else
{
WindowState = WindowState.Normal;
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.FullScreen;
FontIconFullscreen.Icon = SegoeFluentIcons.FullScreen;
}
}
+5 -5
View File
@@ -1,4 +1,4 @@
<Window x:Class="Ink_Canvas.RandWindow"
<Window x:Class="Ink_Canvas.RandWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -100,7 +100,7 @@
<Border x:Name="BorderBtnRand" MouseUp="BorderBtnRand_MouseUp" Background="{DynamicResource RandWindowPrimaryButtonBackground}" Height="70" Width="200" CornerRadius="35">
<ikw:SimpleStackPanel Margin="3,0" Spacing="20" Orientation="Horizontal" HorizontalAlignment="Center">
<Viewbox Margin="0,20">
<ui:SymbolIcon Name="SymbolIconStart" Symbol="Contact" Foreground="White"/>
<ui:FontIcon Name="FontIconStart" Icon="{x:Static ui:SegoeFluentIcons.Contact}" Foreground="White"/>
</Viewbox>
<TextBlock Text="开抽" Foreground="{DynamicResource RandWindowPrimaryButtonForeground}" FontSize="32" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
</ikw:SimpleStackPanel>
@@ -116,7 +116,7 @@
<Border x:Name="BorderBtnExternalCaller" MouseUp="BorderBtnExternalCaller_MouseUp" Background="{DynamicResource RandWindowSecondaryButtonBackground}" Height="50" Width="120" CornerRadius="25">
<ikw:SimpleStackPanel Margin="3,0" Spacing="8" Orientation="Horizontal" HorizontalAlignment="Center">
<Viewbox Margin="0,10">
<ui:SymbolIcon Symbol="Globe" Foreground="White"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Globe}" Foreground="White"/>
</Viewbox>
<TextBlock Text="外部点名" Foreground="{DynamicResource RandWindowSecondaryButtonForeground}" FontSize="16" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
</ikw:SimpleStackPanel>
@@ -130,7 +130,7 @@
</Border.Effect>
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Viewbox Margin="15,12">
<ui:SymbolIcon Symbol="People" Foreground="Black"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.People}" Foreground="Black"/>
</Viewbox>
<TextBlock Margin="-5,12,15,12" Name="TextBlockPeopleCount" Text="点击此处以导入名单" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/>
</ikw:SimpleStackPanel>
@@ -140,7 +140,7 @@
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
</Border.Effect>
<Viewbox Margin="14">
<ui:SymbolIcon Symbol="Clear" Foreground="{DynamicResource RandWindowCloseButtonForeground}"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Clear}" Foreground="{DynamicResource RandWindowCloseButtonForeground}"/>
</Viewbox>
</Border>
</Canvas>
+3 -2
View File
@@ -1,5 +1,6 @@
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
@@ -185,7 +186,7 @@ namespace Ink_Canvas
if (RandMaxPeopleOneTime != -1 && TotalCount >= RandMaxPeopleOneTime) return;
TotalCount++;
LabelNumberCount.Text = TotalCount.ToString();
SymbolIconStart.Symbol = Symbol.People;
FontIconStart.Icon = SegoeFluentIcons.People;
BorderBtnAdd.Opacity = 1;
BorderBtnMinus.Opacity = 1;
}
@@ -197,7 +198,7 @@ namespace Ink_Canvas
LabelNumberCount.Text = TotalCount.ToString();
if (TotalCount == 1)
{
SymbolIconStart.Symbol = Symbol.Contact;
FontIconStart.Icon = SegoeFluentIcons.Contact;
}
}
@@ -1,4 +1,4 @@
<Window x:Class="Ink_Canvas.YesOrNoNotificationWindow"
<Window x:Class="Ink_Canvas.YesOrNoNotificationWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -16,7 +16,7 @@
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Viewbox HorizontalAlignment="Left" Margin="10" Height="30">
<ui:SymbolIcon Symbol="SlideShow" Foreground="{Binding ElementName=Label, Path=Foreground}"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Info}" Foreground="{Binding ElementName=Label, Path=Foreground}"/>
</Viewbox>
<TextBlock TextWrapping="Wrap" Name="Label" Margin="60,0,10,0" VerticalAlignment="Center"/>
<ikw:SimpleStackPanel Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Spacing="10">