Skip to content

Commit

Permalink
迁移外观设置项,更新 iNKORE.UI
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Jul 14, 2024
1 parent e2ccb29 commit d96183c
Show file tree
Hide file tree
Showing 29 changed files with 223 additions and 306 deletions.
2 changes: 1 addition & 1 deletion ZongziTEK_Blackboard_Sticker/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ZongziTEK_Blackboard_Sticker"
StartupUri="MainWindow.xaml"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern">
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
1 change: 1 addition & 0 deletions ZongziTEK_Blackboard_Sticker/Classes/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class Look
public double WindowScaleMultiplier { get; set; } = 1;
public bool IsLightTheme { get; set; } = false;
public bool IsSwitchThemeAuto { get; set; } = true;
public int Theme { get; set;} = 0; // 0 代表自动切换,1 代表浅色,2 代表深色
public bool IsAnimationEnhanced { get; set; } = true;
//public bool UseLiteMode { get; set; } = false;
//public bool IsLiteModeWithInfoBoard { get; set; } = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:local="clr-namespace:ZongziTEK_Blackboard_Sticker.Controls.Cards"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
Expand All @@ -17,10 +17,10 @@
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<ui:FontIcon Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Icon="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=Icon}" FontSize="20"/>
<ui:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<ikw:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<TextBlock Foreground="{DynamicResource ForegroundColor}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource ForegroundColor}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=Tip}"/>
</ui:SimpleStackPanel>
</ikw:SimpleStackPanel>
<ui:ContentPresenterEx Grid.Column="2" Margin="12,0" VerticalAlignment="Center" Content="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:GenericSettingsCard}, Mode=FindAncestor}, Path=CardContent}"/>
</Grid>
</Border>
Expand Down
6 changes: 3 additions & 3 deletions ZongziTEK_Blackboard_Sticker/Controls/Cards/SliderCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:local="clr-namespace:ZongziTEK_Blackboard_Sticker.Controls.Cards"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Loaded="SliderCard_Loaded">
Expand All @@ -17,10 +17,10 @@
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<ui:FontIcon Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Icon="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SliderCard}, Mode=FindAncestor}, Path=Icon}" FontSize="20"/>
<ui:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<ikw:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<TextBlock Foreground="{DynamicResource ForegroundColor}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SliderCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource ForegroundColor}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SliderCard}, Mode=FindAncestor}, Path=Tip}"/>
</ui:SimpleStackPanel>
</ikw:SimpleStackPanel>
<Button Grid.Column="2" Margin="12,0" Height="32" Content="调整该项设置" Background="Transparent" Foreground="{DynamicResource {x:Static ui:ThemeKeys.AccentButtonBackgroundKey}}" BorderThickness="0">
<ui:FlyoutService.Flyout>
<ui:Flyout>
Expand Down
6 changes: 3 additions & 3 deletions ZongziTEK_Blackboard_Sticker/Controls/Cards/TextBoxCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:local="clr-namespace:ZongziTEK_Blackboard_Sticker.Controls.Cards"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
Expand All @@ -17,10 +17,10 @@
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<ui:FontIcon Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Icon="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard}, Mode=FindAncestor}, Path=Icon}" FontSize="20"/>
<ui:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<ikw:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<TextBlock Foreground="{DynamicResource ForegroundColor}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource ForegroundColor}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard}, Mode=FindAncestor}, Path=Tip}"/>
</ui:SimpleStackPanel>
</ikw:SimpleStackPanel>
<TextBox Grid.Column="2" TextChanged="TextBox_TextChanged" VerticalAlignment="Center" Margin="12,0" Width="200" Height="32" Text="{Binding Mode=TwoWay,RelativeSource={RelativeSource AncestorType={x:Type local:TextBoxCard},Mode=FindAncestor},Path=Text}"/>
</Grid>
</Border>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:local="clr-namespace:ZongziTEK_Blackboard_Sticker.Controls.Cards"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
Expand All @@ -17,10 +17,10 @@
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<ui:FontIcon Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Icon="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=Icon}" FontSize="20"/>
<ui:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<ikw:SimpleStackPanel Spacing="2" Grid.Column="1" VerticalAlignment="Center">
<TextBlock Foreground="{DynamicResource ForegroundColor}" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=Header}"/>
<TextBlock Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Text, Converter={StaticResource TextEmptyToCollapsedConverter}}" Foreground="{DynamicResource ForegroundColor}" Opacity="0.75" FontSize="12" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=Tip}"/>
</ui:SimpleStackPanel>
</ikw:SimpleStackPanel>
<ui:ToggleSwitch Grid.Column="2" Toggled="ToggleSwitch_Toggled" OnContent="{Binding Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=OnContent}" OffContent="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=OffContent}" MinWidth="0" Margin="12,0" IsOn="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ToggleSwitchCard}, Mode=FindAncestor}, Path=IsOn}"/>
</Grid>
</Border>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:local="clr-namespace:ZongziTEK_Blackboard_Sticker"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
Expand Down
24 changes: 12 additions & 12 deletions ZongziTEK_Blackboard_Sticker/LauncherEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:local="clr-namespace:ZongziTEK_Blackboard_Sticker"
mc:Ignorable="d"
Title="ZongziTEK 黑板贴 - 编辑启动台" Height="450" Width="800" MinHeight="450" MinWidth="800"
Expand All @@ -27,33 +27,33 @@
<Border Grid.Row="1" Height="52" Margin="16,4,16,8" CornerRadius="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
Background="{DynamicResource {x:Static ui:ThemeKeys.CardBackgroundFillColorDefaultBrushKey}}" Visibility="{Binding Visibility, ElementName=ListScrollViewer}">
<Grid Margin="16,8">
<ui:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="8">
<ikw:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="8">
<Button Width="32" Height="32" Padding="0" BorderThickness="0" Background="#00000000" Click="ButtonRefresh_Click">
<ui:FontIcon Icon="{x:Static ui:FluentSystemIcons.ArrowClockwise_20_Regular}"/>
</Button>

<Rectangle Opacity="0.1" Width="1" Fill="{DynamicResource ForegroundColor}"/>

<Button Height="32" Padding="8,0" BorderThickness="0" Background="#00000000" Click="ButtonNew_Click">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="8">
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
<ui:FontIcon Icon="{x:Static ui:FluentSystemIcons.Add_20_Regular}"/>
<Label Content="新建启动台项"/>
</ui:SimpleStackPanel>
</ikw:SimpleStackPanel>
</Button>
</ui:SimpleStackPanel>
</ikw:SimpleStackPanel>
</Grid>
</Border>
<ui:ScrollViewerEx Name="ListScrollViewer" Grid.Row="2" Margin="16,8,16,0" PanningMode="VerticalOnly">
<ui:SimpleStackPanel x:Name="ListStackPanel" Spacing="8"/>
<ikw:SimpleStackPanel x:Name="ListStackPanel" Spacing="8"/>
</ui:ScrollViewerEx>

<Grid Name="GridInsert" Visibility="Collapsed" Grid.Row="1" Grid.RowSpan="3">
<ui:SimpleStackPanel Margin="24,12,24,12" Spacing="8">
<ikw:SimpleStackPanel Margin="24,12,24,12" Spacing="8">
<TextBlock Text="新建项" FontSize="32"/>
<ui:InfoBar Title="实验性功能" Message="已知问题:某些文件无法添加,或添加后不在启动台中显示" IsOpen="True" IsClosable="False"/>
</ui:SimpleStackPanel>
</ikw:SimpleStackPanel>
<ui:ScrollViewerEx Margin="24,128,24,64" PanningMode="VerticalOnly">
<ui:SimpleStackPanel Spacing="8">
<ikw:SimpleStackPanel Spacing="8">
<TextBlock Text="文件路径" FontSize="16"/>
<Grid Name="GridDataLocation">
<Grid.ColumnDefinitions>
Expand All @@ -66,12 +66,12 @@

<TextBlock Text="名称" FontSize="16"/>
<TextBox Name="TextBoxLinkName"/>
</ui:SimpleStackPanel>
</ikw:SimpleStackPanel>
</ui:ScrollViewerEx>
<ui:SimpleStackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="24,12,24,12" Spacing="8" Orientation="Horizontal" >
<ikw:SimpleStackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="24,12,24,12" Spacing="8" Orientation="Horizontal" >
<Button Name="ButtonCancelNew" Content="取消" Width="80" Click="ButtonCancelNew_Click"/>
<Button Name="ButtonSaveNew" Content="保存" Style="{DynamicResource {x:Static ui:ThemeKeys.AccentButtonStyleKey}}" Width="80" Click="ButtonSaveNew_Click"/>
</ui:SimpleStackPanel>
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</Window>
3 changes: 2 additions & 1 deletion ZongziTEK_Blackboard_Sticker/LauncherEditor.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Controls;
using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using IWshRuntimeLibrary;
Expand Down
Loading

0 comments on commit d96183c

Please sign in to comment.