This commit is contained in:
DismissedLight
2024-06-25 22:39:53 +08:00
parent 1f8a70da0d
commit 0075d79b0c
32 changed files with 336 additions and 267 deletions

View File

@@ -8,10 +8,13 @@
<XamlControlsResources/>
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.SettingsControls/SettingsCard/SettingsCard.xaml"/>
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.TokenizingTextBox/TokenizingTextBox.xaml"/>
<ResourceDictionary Source="ms-appx:///CommunityToolkit.Labs.WinUI.TokenView/TokenItem/TokenItem.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Elevation.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Loading.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/CardBlock.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/CardProgressBar.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/HorizontalCard.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/VerticalCard.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Image/CachedImage.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/Card.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/Color.xaml"/>
@@ -47,15 +50,15 @@
x:Name="NoneSelectionListViewItemStyle"
BasedOn="{StaticResource DefaultListViewItemStyle}"
TargetType="ListViewItem">
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0,4,0,0"/>
<Setter Property="Padding" Value="0"/>
</Style>
<Style
x:Name="NoneSelectionGridViewItemStyle"
BasedOn="{StaticResource DefaultGridViewItemStyle}"
TargetType="GridViewItem">
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0,0,2,4"/>
<Setter Property="Padding" Value="0"/>
</Style>
</ResourceDictionary>
</Application.Resources>

View File

@@ -92,6 +92,8 @@
<None Remove="Control\Panel\LayoutSwitch.xaml" />
<None Remove="UI\Xaml\Control\Card\CardBlock.xaml" />
<None Remove="UI\Xaml\Control\Card\HorizontalCard.xaml" />
<None Remove="UI\Xaml\Control\Card\VerticalCard.xaml" />
<None Remove="UI\Xaml\Control\Elevation.xaml" />
<None Remove="UI\Xaml\Control\Theme\Card.xaml" />
<None Remove="UI\Xaml\Control\Theme\Color.xaml" />
<None Remove="UI\Xaml\Control\Theme\ComboBox.xaml" />
@@ -152,9 +154,7 @@
<None Remove="View\Card\GachaStatisticsCard.xaml" />
<None Remove="View\Card\LaunchGameCard.xaml" />
<None Remove="View\Control\BaseValueSlider.xaml" />
<None Remove="View\Control\BottomTextControl.xaml" />
<None Remove="View\Control\DescParamComboBox.xaml" />
<None Remove="View\Control\Elevation.xaml" />
<None Remove="View\Control\HutaoStatisticsCard.xaml" />
<None Remove="View\Control\ItemIcon.xaml" />
<None Remove="View\Control\LaunchGameResourceExpander.xaml" />
@@ -441,12 +441,6 @@
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Control\Elevation.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\InfoBarView.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -508,11 +502,6 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Control\BottomTextControl.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Page\LoginMihoyoUserPage.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -657,6 +646,16 @@
<Folder Include="UI\Xaml\View\Card\" />
<Folder Include="UI\Xaml\View\Page\" />
</ItemGroup>
<ItemGroup>
<Page Update="UI\Xaml\Control\Card\VerticalCard.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="UI\Xaml\Control\Elevation.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="UI\Xaml\View\Window\WebView2Window.xaml">
<Generator>MSBuild:Compile</Generator>

View File

@@ -6,7 +6,6 @@
<Style BasedOn="{StaticResource DefaultCardProgressBarStyle}" TargetType="shuxcc:CardProgressBar"/>
<Style x:Key="DefaultCardProgressBarStyle" TargetType="shuxcc:CardProgressBar">
<Setter Property="TextForeground" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
<Setter Property="MinHeight" Value="40"/>
<Setter Property="Template">
<Setter.Value>
@@ -44,6 +43,7 @@
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="TextForeground" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
</Style>
</ResourceDictionary>

View File

@@ -13,4 +13,4 @@ internal sealed partial class HorizontalCard : Microsoft.UI.Xaml.Controls.Contro
{
DefaultStyleKey = typeof(HorizontalCard);
}
}
}

View File

@@ -0,0 +1,17 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
namespace Snap.Hutao.UI.Xaml.Control.Card;
[DependencyProperty("Top", typeof(UIElement), default!)]
[DependencyProperty("Bottom", typeof(UIElement), default!)]
[DependencyProperty("BottomPadding", typeof(Thickness), default!)]
internal sealed partial class VerticalCard : Microsoft.UI.Xaml.Controls.Control
{
public VerticalCard()
{
DefaultStyleKey = typeof(VerticalCard);
}
}

View File

@@ -0,0 +1,39 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card">
<Style BasedOn="{StaticResource DefaultVerticalCardStyle}" TargetType="shuxcc:VerticalCard"/>
<Style x:Key="DefaultVerticalCardStyle" TargetType="shuxcc:VerticalCard">
<Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}"/>
<Setter Property="BottomPadding" Value="0,2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="shuxcc:VerticalCard">
<Border Background="{TemplateBinding Background}" Style="{StaticResource BorderCardStyle}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border
x:Name="ContentHost"
cw:FrameworkElementExtensions.EnableActualSizeBinding="True"
Child="{TemplateBinding Top}"/>
<Border
Grid.Row="1"
MaxWidth="{Binding (cw:FrameworkElementExtensions.ActualWidth), ElementName=ElementName, Mode=OneWay}"
Padding="{TemplateBinding BottomPadding}"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Child="{TemplateBinding Bottom}"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -0,0 +1,12 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.UI.Xaml.Control;
internal sealed partial class Elevation : Microsoft.UI.Xaml.Controls.ContentControl
{
public Elevation()
{
DefaultStyleKey = typeof(Elevation);
}
}

View File

@@ -0,0 +1,33 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:clw="using:CommunityToolkit.Labs.WinUI"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup">
<Style BasedOn="{StaticResource DefaultElevationStyle}" TargetType="shuxc:Elevation"/>
<Style x:Key="DefaultElevationStyle" TargetType="shuxc:Elevation">
<Setter Property="Background" Value="{ThemeResource SystemFillColorCriticalBackgroundBrush}"/>
<Setter Property="Content" Value="{shuxm:ResourceString Name=ViewControlElevationText}"/>
<Setter Property="Foreground" Value="{ThemeResource SystemFillColorCriticalBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="shuxc:Elevation">
<clw:TokenItem
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}"
Icon="{shuxm:FontIcon Glyph={StaticResource FontIconContentWarning}}">
<clw:TokenItem.Resources>
<x:Double x:Key="ListViewItemDisabledThemeOpacity">1</x:Double>
</clw:TokenItem.Resources>
</clw:TokenItem>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</ResourceDictionary>

View File

@@ -6,10 +6,8 @@
<Style BasedOn="{StaticResource DefaultLoadingStyle}" TargetType="shuxc:Loading"/>
<Style x:Key="DefaultLoadingStyle" TargetType="shuxc:Loading">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="shuxc:Loading">
@@ -83,6 +81,8 @@
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</ResourceDictionary>

View File

@@ -28,16 +28,16 @@
x:Key="AcrylicBorderCardStyle"
BasedOn="{StaticResource BorderCardStyle}"
TargetType="Border">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style
x:Key="AcrylicSecondaryBorderCardStyle"
BasedOn="{StaticResource BorderCardStyle}"
TargetType="Border">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{ThemeResource SystemControlChromeMediumAcrylicElementMediumBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style x:Key="GridCardStyle" TargetType="Grid">
@@ -51,15 +51,15 @@
x:Key="AcrylicGridCardStyle"
BasedOn="{StaticResource GridCardStyle}"
TargetType="Grid">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style
x:Key="AcrylicSecondaryGridCardStyle"
BasedOn="{StaticResource GridCardStyle}"
TargetType="Grid">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{ThemeResource SystemControlChromeMediumAcrylicElementMediumBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
</ResourceDictionary>

View File

@@ -3,8 +3,8 @@
x:Key="CommandBarComboBoxStyle"
BasedOn="{StaticResource DefaultComboBoxStyle}"
TargetType="ComboBox">
<Setter Property="Padding" Value="12,7,0,7"/>
<Setter Property="Height" Value="36"/>
<Setter Property="Padding" Value="12,7,0,7"/>
</Style>
<!-- https://github.com/microsoft/microsoft-ui-xaml/issues/4811 -->
<x:Int32 x:Key="__DiscardPageOverride">0</x:Int32>

View File

@@ -3,8 +3,8 @@
x:Key="WebViewerFlyoutPresenterStyle"
BasedOn="{StaticResource DefaultFlyoutPresenterStyle}"
TargetType="FlyoutPresenter">
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}"/>
<Setter Property="Padding" Value="0"/>
</Style>
<Style
x:Key="FlyoutPresenterPadding0And2Style"

View File

@@ -13,10 +13,10 @@
<Setter Property="FontFamily" Value="{StaticResource MiSans}"/>
<Setter Property="FontSize" Value="{StaticResource BodyTextBlockFontSize}"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="LineStackingStrategy" Value="MaxHeight"/>
<Setter Property="TextLineBounds" Value="Full"/>
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<Style
x:Key="HeaderTextBlockStyle"
@@ -101,11 +101,11 @@
BasedOn="{StaticResource BodyTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource TextControlTextForeground}"/>
<Setter Property="Margin" Value="{StaticResource TextControlTextMargin}"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalTextAlignment" Value="Center"/>
<Setter Property="Margin" Value="{StaticResource TextControlTextMargin}"/>
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
<Setter Property="TextWrapping" Value="NoWrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</ResourceDictionary>

View File

@@ -61,16 +61,15 @@
<!-- TODO: When will DefaultInfoBarStyle added -->
<Style TargetType="InfoBar">
<Setter Property="shuxc:InfoBarHelper.IsTextSelectionEnabled" Value="False"/>
<Setter Property="FontFamily" Value="{StaticResource MiSans}"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="CloseButtonStyle" Value="{StaticResource InfoBarCloseButtonStyle}"/>
<Setter Property="AutomationProperties.IsDialog" Value="True"/>
<Setter Property="AutomationProperties.LandmarkType" Value="Custom"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="{ThemeResource InfoBarBorderBrush}"/>
<Setter Property="BorderThickness" Value="{ThemeResource InfoBarBorderThickness}"/>
<Setter Property="AutomationProperties.LandmarkType" Value="Custom"/>
<Setter Property="AutomationProperties.IsDialog" Value="True"/>
<Setter Property="CloseButtonStyle" Value="{StaticResource InfoBarCloseButtonStyle}"/>
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}"/>
<Setter Property="FontFamily" Value="{StaticResource MiSans}"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="InfoBar">
@@ -324,5 +323,6 @@
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="shuxc:InfoBarHelper.IsTextSelectionEnabled" Value="False"/>
</Style>
</ResourceDictionary>

View File

@@ -7,8 +7,6 @@
<Thickness x:Key="PivotItemMargin">0</Thickness>
<Style x:Key="CardPivotStyle" TargetType="Pivot">
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Background" Value="{ThemeResource PivotBackground}"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="ItemsPanel">
@@ -18,6 +16,8 @@
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Pivot">
@@ -50,8 +50,8 @@
BasedOn="{StaticResource BaseContentControlStyle}"
TargetType="ContentControl">
<Setter Property="FontFamily" Value="{ThemeResource PivotTitleFontFamily}"/>
<Setter Property="FontWeight" Value="{ThemeResource PivotTitleThemeFontWeight}"/>
<Setter Property="FontSize" Value="{ThemeResource PivotTitleFontSize}"/>
<Setter Property="FontWeight" Value="{ThemeResource PivotTitleThemeFontWeight}"/>
</Style>
</Grid.Resources>
@@ -380,8 +380,6 @@
</Setter>
</Style>
<Style x:Key="CardPivotStyle2" TargetType="Pivot">
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Background" Value="{ThemeResource PivotBackground}"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="ItemsPanel">
@@ -391,6 +389,8 @@
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Pivot">
@@ -423,8 +423,8 @@
BasedOn="{StaticResource BaseContentControlStyle}"
TargetType="ContentControl">
<Setter Property="FontFamily" Value="{ThemeResource PivotTitleFontFamily}"/>
<Setter Property="FontWeight" Value="{ThemeResource PivotTitleThemeFontWeight}"/>
<Setter Property="FontSize" Value="{ThemeResource PivotTitleFontSize}"/>
<Setter Property="FontWeight" Value="{ThemeResource PivotTitleThemeFontWeight}"/>
</Style>
</Grid.Resources>

View File

@@ -3,20 +3,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control">
<Style x:Key="TwoPanelScrollViewerStyle" TargetType="ScrollViewer">
<Setter Property="HorizontalScrollMode" Value="Auto"/>
<Setter Property="VerticalScrollMode" Value="Auto"/>
<Setter Property="IsHorizontalRailEnabled" Value="True"/>
<Setter Property="IsVerticalRailEnabled" Value="True"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="ZoomMode" Value="Disabled"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="HorizontalScrollMode" Value="Auto"/>
<Setter Property="IsHorizontalRailEnabled" Value="True"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="IsVerticalRailEnabled" Value="True"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollViewer">
@@ -282,5 +277,10 @@
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
<Setter Property="VerticalScrollMode" Value="Auto"/>
<Setter Property="ZoomMode" Value="Disabled"/>
</Style>
</ResourceDictionary>

View File

@@ -41,9 +41,9 @@
TargetType="Button">
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}"/>
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}"/>
<Setter Property="Padding" Value="16,6,16,6"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="MinWidth" Value="{ThemeResource SettingsCardContentControlMinWidth}"/>
<Setter Property="Padding" Value="16,6,16,6"/>
</Style>
</ResourceDictionary>

View File

@@ -11,13 +11,14 @@
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxct="using:Snap.Hutao.UI.Xaml.Control.TextBlock"
xmlns:shuxdc="using:Snap.Hutao.UI.Xaml.Data.Converter"
xmlns:shuxdcs="using:Snap.Hutao.UI.Xaml.Data.Converter.Specialized"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shva="using:Snap.Hutao.ViewModel.AvatarProperty"
xmlns:shvcont="using:Snap.Hutao.View.Control"
xmlns:shuxdc="using:Snap.Hutao.UI.Xaml.Data.Converter"
xmlns:shuxdcs="using:Snap.Hutao.UI.Xaml.Data.Converter.Specialized"
d:DataContext="{d:DesignInstance shva:AvatarPropertyViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
@@ -58,19 +59,20 @@
ListValue="{x:Bind ListImageExportPanel}"/>
<DataTemplate x:Key="AvatarGridViewSkillTemplate">
<shvcont:BottomTextControl
Grid.Row="0"
Grid.Column="0"
Margin="0"
Text="{Binding Level}">
<shuxci:MonoChrome
Width="40"
Height="40"
Margin="12"
HorizontalAlignment="Center"
EnableShowHideAnimation="False"
Source="{Binding Icon}"/>
</shvcont:BottomTextControl>
<shuxcc:VerticalCard>
<shuxcc:VerticalCard.Top>
<shuxci:MonoChrome
Width="40"
Height="40"
Margin="12"
HorizontalAlignment="Center"
EnableShowHideAnimation="False"
Source="{Binding Icon}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding Level}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
</DataTemplate>
<DataTemplate x:Key="AvatarGridViewTemplate">
@@ -97,45 +99,54 @@
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<shvcont:BottomTextControl Grid.Column="0" Text="{Binding Level}">
<Grid cw:UIElementExtensions.ClipToBounds="True" CornerRadius="{ThemeResource ControlCornerRadius}">
<shvcont:ItemIcon
Width="64"
Height="64"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
<Border
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="#80000000"
CornerRadius="0,0,0,6">
<TextBlock
Margin="6,0,6,2"
Foreground="#FFFFFFFF"
Text="{Binding ActivatedConstellationCount}"/>
</Border>
</Grid>
</shvcont:BottomTextControl>
<shvcont:BottomTextControl Grid.Column="1" Text="{Binding Weapon.Level}">
<Grid cw:UIElementExtensions.ClipToBounds="True" CornerRadius="{ThemeResource ControlCornerRadius}">
<shvcont:ItemIcon
Width="64"
Height="64"
Icon="{Binding Weapon.Icon}"
Quality="{Binding Weapon.Quality}"/>
<Border
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="#80000000"
CornerRadius="0,0,0,6">
<TextBlock
Margin="6,0,6,2"
Foreground="#FFFFFFFF"
Text="{Binding Weapon.AffixLevelNumber}"/>
</Border>
</Grid>
</shvcont:BottomTextControl>
<shuxcc:VerticalCard Grid.Column="0">
<shuxcc:VerticalCard.Top>
<Grid cw:UIElementExtensions.ClipToBounds="True" CornerRadius="{ThemeResource ControlCornerRadius}">
<shvcont:ItemIcon
Width="64"
Height="64"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
<Border
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="#80000000"
CornerRadius="0,0,0,6">
<TextBlock
Margin="6,0,6,2"
Foreground="#FFFFFFFF"
Text="{Binding ActivatedConstellationCount}"/>
</Border>
</Grid>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding Level}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
<shuxcc:VerticalCard Grid.Column="1">
<shuxcc:VerticalCard.Top>
<Grid cw:UIElementExtensions.ClipToBounds="True" CornerRadius="{ThemeResource ControlCornerRadius}">
<shvcont:ItemIcon
Width="64"
Height="64"
Icon="{Binding Weapon.Icon}"
Quality="{Binding Weapon.Quality}"/>
<Border
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="#80000000"
CornerRadius="0,0,0,6">
<TextBlock
Margin="6,0,6,2"
Foreground="#FFFFFFFF"
Text="{Binding Weapon.AffixLevelNumber}"/>
</Border>
</Grid>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding Weapon.Level}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
<ItemsControl
Grid.Column="2"
VerticalAlignment="Bottom"

View File

@@ -224,9 +224,14 @@
Background="Transparent"
BorderBrush="{x:Null}"
BorderThickness="0">
<shvco:BottomTextControl Text="{Binding Count, Mode=OneWay}">
<shvco:ItemIcon Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Inner.RankLevel}"/>
</shvco:BottomTextControl>
<shuxcc:VerticalCard>
<shuxcc:VerticalCard.Top>
<shvco:ItemIcon Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Inner.RankLevel}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding Count, Mode=OneWay}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
<Button.Flyout>
<Flyout>
<Grid>

View File

@@ -169,7 +169,7 @@
</StackPanel>
</cwc:SettingsCard.Description>
<StackPanel Orientation="Horizontal" Spacing="{ThemeResource SettingsCardContentControlSpacing}">
<shvc:Elevation Visibility="{Binding RuntimeOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
<shuxc:Elevation Visibility="{Binding RuntimeOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
<shuxc:SizeRestrictedContentControl>
<shuxc:ComboBox2
DisplayMemberPath="DisplayName"
@@ -313,7 +313,7 @@
IsEnabled="{Binding RuntimeOptions.IsElevated}"
Visibility="{Binding LaunchOptions.IsAdvancedLaunchOptionsEnabled, Converter={StaticResource BoolToVisibilityConverter}}">
<StackPanel Orientation="Horizontal" Spacing="10">
<shvc:Elevation Visibility="{Binding RuntimeOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
<shuxc:Elevation Visibility="{Binding RuntimeOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
<NumberBox
MinWidth="{ThemeResource SettingsCardContentControlMinWidth2}"
Padding="10,8,0,0"

View File

@@ -429,7 +429,7 @@
HeaderIcon="{shuxm:FontIcon Glyph=&#xE92E;}"
IsEnabled="{Binding RuntimeOptions.IsElevated}">
<StackPanel Orientation="Horizontal" Spacing="8">
<shvc:Elevation Margin="0,0,16,0" Visibility="{Binding RuntimeOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
<shuxc:Elevation Margin="0,0,16,0" Visibility="{Binding RuntimeOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
<Button
MinWidth="32"
MinHeight="32"
@@ -609,7 +609,7 @@
</StackPanel>
</cwc:SettingsExpander.Description>
<StackPanel Orientation="Horizontal">
<shvc:Elevation Visibility="{Binding RuntimeOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
<shuxc:Elevation Visibility="{Binding RuntimeOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
<ToggleSwitch Width="120" IsOn="{Binding IsAdvancedLaunchOptionsEnabled, Mode=TwoWay}"/>
</StackPanel>
<cwc:SettingsExpander.Items>

View File

@@ -467,13 +467,18 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<shvcon:BottomTextControl Text="{Binding Value}">
<shvcon:ItemIcon
Width="52"
Height="52"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
</shvcon:BottomTextControl>
<shuxcc:VerticalCard>
<shuxcc:VerticalCard.Top>
<shvcon:ItemIcon
Width="52"
Height="52"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding Value}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

View File

@@ -289,9 +289,14 @@
</DataTemplate>
<DataTemplate x:Key="AvatarGridTemplate">
<shvcont:BottomTextControl Text="{Binding Name}">
<shvcont:ItemIcon Icon="{Binding Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
</shvcont:BottomTextControl>
<shuxcc:VerticalCard>
<shuxcc:VerticalCard.Top>
<shvcont:ItemIcon Icon="{Binding Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding Name}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
</DataTemplate>
</Page.Resources>
@@ -660,25 +665,33 @@
Grid.Column="0"
Style="{StaticResource BaseTextBlockStyle}"
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarSpecialFoodTitle}"/>
<shvcont:BottomTextControl
<shuxcc:VerticalCard
Grid.Row="1"
Grid.Column="0"
Margin="0,16,0,0"
Text="{Binding Item.Name}">
<shvcont:ItemIcon Icon="{Binding Item.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Item.RankLevel}"/>
</shvcont:BottomTextControl>
Margin="0,16,0,0">
<shuxcc:VerticalCard.Top>
<shvcont:ItemIcon Icon="{Binding Item.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Item.RankLevel}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding Item.Name}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
<TextBlock
Grid.Column="1"
Margin="16,0,0,0"
Style="{StaticResource BaseTextBlockStyle}"
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarOriginalFoodTitle}"/>
<shvcont:BottomTextControl
<shuxcc:VerticalCard
Grid.Row="1"
Grid.Column="1"
Margin="16,16,0,0"
Text="{Binding OriginItem.Name}">
<shvcont:ItemIcon Icon="{Binding OriginItem.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding OriginItem.RankLevel}"/>
</shvcont:BottomTextControl>
Margin="16,16,0,0">
<shuxcc:VerticalCard.Top>
<shvcont:ItemIcon Icon="{Binding OriginItem.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding OriginItem.RankLevel}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding OriginItem.Name}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
<StackPanel
Grid.RowSpan="4"
Grid.Column="2"

View File

@@ -75,9 +75,14 @@
</DataTemplate>
<DataTemplate x:Key="MonsterGridTemplate">
<shvc:BottomTextControl Text="{Binding Name}">
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource MonsterIconConverter}, Mode=OneWay}" Quality="QUALITY_NONE"/>
</shvc:BottomTextControl>
<shuxcc:VerticalCard>
<shuxcc:VerticalCard.Top>
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource MonsterIconConverter}, Mode=OneWay}" Quality="QUALITY_NONE"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding Name}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
</DataTemplate>
</Page.Resources>

View File

@@ -151,9 +151,14 @@
</DataTemplate>
<DataTemplate x:Key="WeaponGridTemplate">
<shvc:BottomTextControl Text="{Binding Name}">
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource EquipIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
</shvc:BottomTextControl>
<shuxcc:VerticalCard>
<shuxcc:VerticalCard.Top>
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource EquipIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{Binding Name}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
</DataTemplate>
</Page.Resources>
@@ -267,14 +272,23 @@
Grid.Column="0"
Margin="16"
VerticalScrollBarVisibility="Hidden">
<StackPanel>
<shvc:BottomTextControl MaxWidth="80" Text="{shuxm:ResourceString Name=ViewPageWiKiWeaponBeforeAscensionTitle}">
<shvc:ItemIcon Icon="{Binding Selected.Icon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
</shvc:BottomTextControl>
<shvc:BottomTextControl Margin="0,16,0,0" Text="{shuxm:ResourceString Name=ViewPageWiKiWeaponAfterAscensionTitle}">
<shvc:ItemIcon Icon="{Binding Selected.AwakenIcon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
</shvc:BottomTextControl>
<StackPanel Spacing="16">
<shuxcc:VerticalCard MaxWidth="80">
<shuxcc:VerticalCard.Top>
<shvc:ItemIcon Icon="{Binding Selected.Icon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{shuxm:ResourceString Name=ViewPageWiKiWeaponBeforeAscensionTitle}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
<shuxcc:VerticalCard MaxWidth="80">
<shuxcc:VerticalCard.Top>
<shvc:ItemIcon Icon="{Binding Selected.AwakenIcon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Text="{shuxm:ResourceString Name=ViewPageWiKiWeaponAfterAscensionTitle}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
</StackPanel>
</ScrollViewer>

View File

@@ -1,30 +0,0 @@
<UserControl
x:Class="Snap.Hutao.View.Control.BottomTextControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
mc:Ignorable="d">
<Border Style="{StaticResource BorderCardStyle}">
<StackPanel Background="{x:Bind Fill}">
<ContentPresenter
x:Name="ContentHost"
cw:FrameworkElementExtensions.EnableActualSizeBinding="True"
Content="{x:Bind TopContent, Mode=OneWay}"/>
<TextBlock
MaxWidth="{x:Bind ContentHost.(cw:FrameworkElementExtensions.ActualWidth), Mode=OneWay}"
Margin="0,1"
HorizontalAlignment="Stretch"
Foreground="{x:Bind Foreground}"
HorizontalTextAlignment="Center"
Style="{x:Bind TextStyle, Mode=OneWay}"
Text="{x:Bind Text, Mode=OneWay}"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"/>
</StackPanel>
</Border>
</UserControl>

View File

@@ -1,30 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
namespace Snap.Hutao.View.Control;
/// <summary>
/// 底部带有文本的控件
/// </summary>
[HighQuality]
[ContentProperty(Name = nameof(TopContent))]
[DependencyProperty("Text", typeof(string), "")]
[DependencyProperty("TextStyle", typeof(Style))]
[DependencyProperty("Fill", typeof(Brush), default!)]
[DependencyProperty("TopContent", typeof(FrameworkElement), default!)]
internal sealed partial class BottomTextControl : UserControl
{
/// <summary>
/// 构造一个新的底部带有文本的控件
/// </summary>
public BottomTextControl()
{
TextStyle = Ioc.Default.GetRequiredService<IAppResourceProvider>().GetResource<Style>("BodyTextBlockStyle");
InitializeComponent();
}
}

View File

@@ -1,18 +0,0 @@
<clw:TokenItem
x:Class="Snap.Hutao.View.Control.Elevation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:clw="using:CommunityToolkit.Labs.WinUI"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
VerticalAlignment="Center"
Background="{ThemeResource SystemFillColorCriticalBackgroundBrush}"
Content="{shuxm:ResourceString Name=ViewControlElevationText}"
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
Icon="{shuxm:FontIcon Glyph={StaticResource FontIconContentWarning}}"
mc:Ignorable="d">
<clw:TokenItem.Resources>
<x:Double x:Key="ListViewItemDisabledThemeOpacity">1</x:Double>
</clw:TokenItem.Resources>
</clw:TokenItem>

View File

@@ -1,20 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using CommunityToolkit.Labs.WinUI;
namespace Snap.Hutao.View.Control;
/// <summary>
/// 管理员提示
/// </summary>
internal sealed partial class Elevation : TokenItem
{
/// <summary>
/// 构造一个新的管理员提示
/// </summary>
public Elevation()
{
InitializeComponent();
}
}

View File

@@ -7,6 +7,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:shux="using:Snap.Hutao.UI.Xaml"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvcont="using:Snap.Hutao.View.Control"
@@ -17,12 +18,17 @@
<UserControl.Resources>
<DataTemplate x:Key="GridTemplate" d:DataType="shvg:StatisticsItem">
<shvcont:BottomTextControl Text="{Binding Count}" TextStyle="{StaticResource CaptionTextBlockStyle}">
<shvcont:ItemIcon
shux:FrameworkElementHelper.SquareLength="40"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
</shvcont:BottomTextControl>
<shuxcc:VerticalCard>
<shuxcc:VerticalCard.Top>
<shvcont:ItemIcon
shux:FrameworkElementHelper.SquareLength="40"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Text="{Binding Count}"/>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
</DataTemplate>
</UserControl.Resources>

View File

@@ -7,7 +7,6 @@
<Style x:Key="DefaultRateDeltaTextBlockStyle" TargetType="shvc:RateDeltaTextBlock">
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
<Setter Property="TextStyle" Value="{StaticResource BodyTextBlockStyle}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="shvc:RateDeltaTextBlock">
@@ -35,5 +34,6 @@
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="TextStyle" Value="{StaticResource BodyTextBlockStyle}"/>
</Style>
</ResourceDictionary>

View File

@@ -94,19 +94,24 @@
TrueValue="{ThemeResource CardBackgroundFillColorDefaultBrush}"/>
<DataTemplate x:Key="OrangeGridTemplate" d:DataType="shvg:SummaryItem">
<shvcont:BottomTextControl
<shuxcc:VerticalCard
Background="{Binding IsUp, Converter={StaticResource BoolToBrushConverter}}"
Text="{Binding LastPull}"
TextStyle="{StaticResource CaptionTextBlockStyle}"
BottomPadding="0,1"
ToolTipService.ToolTip="{Binding TimeFormatted}">
<shvcont:BottomTextControl.Foreground>
<SolidColorBrush Color="{Binding Color}"/>
</shvcont:BottomTextControl.Foreground>
<shvcont:ItemIcon
shux:FrameworkElementHelper.SquareLength="40"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
</shvcont:BottomTextControl>
<shuxcc:VerticalCard.Top>
<shvcont:ItemIcon
shux:FrameworkElementHelper.SquareLength="40"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
</shuxcc:VerticalCard.Top>
<shuxcc:VerticalCard.Bottom>
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Text="{Binding LastPull}">
<TextBlock.Foreground>
<SolidColorBrush Color="{Binding Color}"/>
</TextBlock.Foreground>
</TextBlock>
</shuxcc:VerticalCard.Bottom>
</shuxcc:VerticalCard>
</DataTemplate>
</UserControl.Resources>