💄 布局调整

This commit is contained in:
RMBGAME
2023-08-12 01:30:39 +08:00
parent 53725abc91
commit 89dfdff117
11 changed files with 193 additions and 91 deletions
@@ -30,7 +30,7 @@
</spp:AppItem.MoreFlyout>
<spp:AppItem.Image>
<spp:Image2
Height="60"
Width="60"
Source="avares://BD.WTTS.Client.Avalonia/UI/Assets/mona-loading-default.gif"
Stretch="Uniform" />
</spp:AppItem.Image>
@@ -145,14 +145,13 @@
ItemsJustification="Start"
ItemsStretch="Uniform"
MinColumnSpacing="10"
MinItemHeight="160"
MinItemWidth="400"
MinRowSpacing="10" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate DataType="spp:ScriptDTO">
<spp:AppItem
Title="{Binding Name}"
MaxHeight="160"
Description="{Binding Describe}">
<spp:AppItem Title="{Binding Name}" Description="{Binding Describe}">
<spp:AppItem.Status>
<ToggleSwitch Classes="LeftContent" IsChecked="{Binding !Disable, Mode=TwoWay}" />
</spp:AppItem.Status>
@@ -229,15 +228,15 @@
<spp:AppItem.Image>
<Panel>
<spp:Image2
Height="80"
Height="64"
FallbackSource="avares://BD.WTTS.Client.Plugins.Accelerator/UI/Assets/script.ico"
IsVisible="{Binding !IsLoading}"
RenderOptions.BitmapInterpolationMode="HighQuality"
Source="{Binding IconUrl}"
Stretch="Uniform" />
<ProgressBar
Width="80"
Height="80"
Width="64"
Height="64"
Classes="Circle"
IsIndeterminate="True"
IsVisible="{Binding IsLoading}"
@@ -27,7 +27,7 @@ public sealed class Plugin : PluginBase<Plugin>, IPlugin
yield return new MenuTabItemViewModel()
{
ResourceKeyOrName = nameof(Strings.LocalAuth),
PageType = typeof(AuthenticatorHomePage),
PageType = typeof(MainFramePage),
IsResourceGet = true,
IconKey = Icon,
};
@@ -7,20 +7,22 @@
xmlns:s="https://steampp.net/services"
xmlns:spp="https://steampp.net/ui"
xmlns:ui="using:FluentAvalonia.UI.Controls"
d:DesignHeight="300"
d:DesignWidth="600"
x:CompileBindings="True"
x:DataType="spp:AuthenticatorItemModel"
Classes.IsActive="{Binding IsSelected}"
mc:Ignorable="d">
<spp:AppItem
Title="{Binding AuthName}"
MaxHeight="150"
ImageMargin="10"
MoreFlyout="{Binding $parent.ContextFlyout}">
<spp:AppItem.Tags>
<TextBlock Text="{Binding AuthData.Platform}" />
</spp:AppItem.Tags>
<spp:AppItem.ActionButton>
<StackPanel Orientation="Horizontal" Spacing="8">
<Button
<!--<Button
Command="{Binding CopyCode}"
Theme="{StaticResource TransparentButton}"
ToolTip.Tip="{ReflectionBinding Path=Res.LocalAuth_Copy,
@@ -29,7 +31,7 @@
<Viewbox Width="20">
<ui:SymbolIcon Symbol="Copy" />
</Viewbox>
</Button>
</Button>-->
<Button
Command="{Binding EditAuthNameAsync}"
Theme="{StaticResource TransparentButton}"
@@ -74,7 +76,10 @@
</StackPanel>
</spp:AppItem.ActionButton>
<spp:AppItem.Status>
<Border Classes="Status">
<Border
x:Name="ToggleEye"
Classes="Status"
Cursor="Hand">
<!--<TextBlock Text="展示中" />-->
<Border.Styles>
<Style Selector="ui|FontIcon.Eye">
@@ -97,7 +102,7 @@
</ToggleButton>-->
</spp:AppItem.Status>
<spp:AppItem.Image>
<Panel Width="100" Margin="10">
<Panel x:Name="CodePanel" Width="100">
<Arc
Width="{Binding $parent.Width}"
Height="{Binding $parent.Width}"
@@ -134,26 +139,28 @@
IsVisible="{Binding IsShowCode}"
Maximum="{Binding AuthData.Value.Period, Mode=OneTime}"
Value="{Binding Value, Mode=OneWay}" />
<TextBlock
<Button
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="20"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding Code}"
Theme="{StaticResource TitleTextBlockStyle}" />
<!--<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="10"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
TextAlignment="Center">
<Run
Classes="Plain"
Command="{Binding CopyCode}"
Cursor="Hand"
Theme="{StaticResource TransparentButton}"
ToolTip.Tip="{ReflectionBinding Path=Res.Copy,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}">
<!--<StackPanel Orientation="Horizontal">-->
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="{Binding Code}" />
<LineBreak />
<Run Text="单击复制" />
</TextBlock>-->
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding Code}"
Theme="{StaticResource TitleTextBlockStyle}" />
<!--<Viewbox Width="12">
<ui:SymbolIcon Symbol="Copy" />
</Viewbox>
</StackPanel>-->
</Button>
</Panel>
</spp:AppItem.Image>
</spp:AppItem>
@@ -10,7 +10,7 @@ public partial class AuthenticatorItem : UserControl
{
InitializeComponent();
this.Tapped += AuthenticatorItem_Tapped;
ToggleEye.Tapped += AuthenticatorItem_Tapped;
//this.DoubleTapped += AuthenticatorItem_DoubleTapped;
}
@@ -22,7 +22,7 @@ public partial class AuthenticatorItem : UserControl
// }
//}
private async void AuthenticatorItem_Tapped(object? sender, TappedEventArgs e)
private void AuthenticatorItem_Tapped(object? sender, TappedEventArgs e)
{
if (DataContext is AuthenticatorItemModel authenticatorItemModel)
{
@@ -110,57 +110,27 @@
Source={x:Static s:ResourceService.Current}}" />
</Panel>
</Button>
<Button
<ToggleButton
Padding="8,4"
DockPanel.Dock="Right"
Theme="{StaticResource TransparentButton}">
<Button.Flyout>
<Flyout Placement="BottomEdgeAlignedLeft">
<StackPanel Spacing="5">
<Button
Command="{Binding SetPasswordProtection}"
Content="{ReflectionBinding Path=Res.Auth_AddPasswordProtect,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsEnabled="{Binding !HasPasswordEncrypt}" />
<Button
Command="{Binding RemovePasswordProtection}"
Content="{ReflectionBinding Path=Res.Auth_RemovePasswordProtect,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsEnabled="{Binding HasPasswordEncrypt}" />
<Button
Command="{Binding ToggleLocalProtection}"
Content="{ReflectionBinding Path=Res.Auth_AddMachineValidation,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsEnabled="{Binding !HasLocalPcEncrypt}" />
<Button
Command="{Binding ToggleLocalProtection}"
Content="{ReflectionBinding Path=Res.Auth_RemoveMachineValidation,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsEnabled="{Binding HasLocalPcEncrypt}" />
<Button Command="{Binding EncryptHelp}" Content="{ReflectionBinding Path=Res.Auth_EncryptionHelp, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
</StackPanel>
</Flyout>
</Button.Flyout>
IsChecked="{Binding $parent[spp:PageBase].IsPaneOpen, Mode=TwoWay}"
Theme="{StaticResource TransparentToggleButton}">
<Panel>
<Viewbox
Width="16"
Height="16"
HorizontalAlignment="Left">
<ui:FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="{StaticResource Lock}" />
<ui:SymbolIcon Symbol="Settings" />
</Viewbox>
<TextBlock
Margin="28,4,0,4"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{ReflectionBinding Path=Res.EncryptSettings,
Text="{ReflectionBinding Path=Res.Settings_Auth,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}" />
</Panel>
</Button>
</ToggleButton>
<DropDownButton
Padding="8"
HorizontalContentAlignment="Center"
@@ -191,12 +161,12 @@
<!-- <ui:MenuFlyoutItem Command="{Binding EncryptHelp}" Text="加密帮助" /> -->
<!-- </ui:MenuFlyoutSubItem> -->
<ui:MenuFlyoutItem Command="{Binding OpenExportWindow}" Text="{ReflectionBinding Path=Res.ExportAll, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<ui:MenuFlyoutItem
<!--<ui:MenuFlyoutItem
Command="{Binding ReLockAuthenticator}"
IsEnabled="{Binding IsVerificationPass}"
Text="{ReflectionBinding Path=Res.Auth_lock,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}" />
Source={x:Static s:ResourceService.Current}}" />-->
<ui:MenuFlyoutItem Command="{Binding ShowRecoverWindow}" Text="{ReflectionBinding Path=Res.Auth_Sync_Recover, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<ui:MenuFlyoutItem Command="{Binding ResetIndependentPassword}" Text="{ReflectionBinding Path=Res.Auth_Sync_ResetPassword, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<ui:MenuFlyoutItem Text="{ReflectionBinding Path=Res.Settings_Plugin, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
@@ -211,6 +181,43 @@
</StackPanel>
</spp:PageBase.ActionContent>
<spp:PageBase.PaneContent>
<StackPanel Margin="15,20" Spacing="10">
<TextBlock Text="{ReflectionBinding Path=Res.EncryptSettings, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" Theme="{StaticResource BodyStrongTextBlockStyle}" />
<Button
Command="{Binding ReLockAuthenticator}"
Content="{ReflectionBinding Path=Res.Auth_lock,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsEnabled="{Binding HasPasswordEncrypt}" />
<Button
Command="{Binding SetPasswordProtection}"
Content="{ReflectionBinding Path=Res.Auth_AddPasswordProtect,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsEnabled="{Binding !HasPasswordEncrypt}" />
<Button
Command="{Binding RemovePasswordProtection}"
Content="{ReflectionBinding Path=Res.Auth_RemovePasswordProtect,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsEnabled="{Binding HasPasswordEncrypt}" />
<Button
Command="{Binding ToggleLocalProtection}"
Content="{ReflectionBinding Path=Res.Auth_AddMachineValidation,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsEnabled="{Binding !HasLocalPcEncrypt}" />
<Button
Command="{Binding ToggleLocalProtection}"
Content="{ReflectionBinding Path=Res.Auth_RemoveMachineValidation,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsEnabled="{Binding HasLocalPcEncrypt}" />
<Button Command="{Binding EncryptHelp}" Content="{ReflectionBinding Path=Res.Auth_EncryptionHelp, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
</StackPanel>
</spp:PageBase.PaneContent>
<Panel>
<StackPanel
HorizontalAlignment="Center"
@@ -268,6 +275,7 @@
ItemsJustification="Start"
ItemsStretch="Uniform"
MinColumnSpacing="10"
MinItemHeight="150"
MinRowSpacing="10" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
@@ -0,0 +1,46 @@
<UserControl
x:Class="BD.WTTS.UI.Views.Pages.MainFramePage"
xmlns="https://github.com/avaloniaui"
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:s="https://steampp.net/services"
xmlns:spp="https://steampp.net/ui"
xmlns:ui="using:FluentAvalonia.UI.Controls"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Panel>
<TabStrip
Name="Tabs"
Margin="9"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="{DynamicResource ControlOnImageFillColorDefaultBrush}"
CornerRadius="{StaticResource ControlCornerRadius}"
ItemContainerTheme="{StaticResource TabItemStyle}"
Theme="{StaticResource TabStripStyle}"
ZIndex="100">
<TabStrip.ItemsPanel>
<OnFormFactor Default="{StaticResource DefaultPanel}">
<On Options="Mobile">
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</On>
</OnFormFactor>
</TabStrip.ItemsPanel>
<TabStripItem Content="已有令牌">
<TabStripItem.Tag>
<x:Type TypeName="spp:AuthenticatorHomePage" />
</TabStripItem.Tag>
</TabStripItem>
<TabStripItem Content="Steam 市场">
<TabStripItem.Tag>
<x:Type TypeName="spp:SteamTradePage" />
</TabStripItem.Tag>
</TabStripItem>
</TabStrip>
<ui:Frame Name="InnerNavFrame" IsNavigationStackEnabled="False" />
</Panel>
</UserControl>
@@ -0,0 +1,43 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Interactivity;
using FluentAvalonia.UI.Media.Animation;
namespace BD.WTTS.UI.Views.Pages;
public partial class MainFramePage : UserControl
{
int lastIndex = -1;
public MainFramePage()
{
InitializeComponent();
//Tabs.Items.Add(new TabStripItem { Content = Strings.CommunityFix, Tag = typeof(AcceleratorPage) });
//Tabs.Items.Add(new TabStripItem { Content = Strings.ScriptConfig, Tag = typeof(ScriptPage) });
Tabs.SelectionChanged += Tabs_SelectionChanged;
}
protected override void OnLoaded(RoutedEventArgs e)
{
base.OnLoaded(e);
Tabs_SelectionChanged(null, null);
}
private void Tabs_SelectionChanged(object? sender, Avalonia.Controls.SelectionChangedEventArgs? e)
{
if (Tabs.SelectedItem is TabStripItem tab && tab.Tag is Type t)
{
InnerNavFrame.Navigate(t, null, new SlideNavigationTransitionInfo
{
Effect = FrameEffect.GetEffect(lastIndex, Tabs.SelectedIndex),
FromHorizontalOffset = 70,
});
lastIndex = Tabs.SelectedIndex;
}
}
}
@@ -496,6 +496,8 @@
ItemsJustification="Start"
ItemsStretch="Uniform"
MinColumnSpacing="10"
MinItemHeight="340"
MinItemWidth="169"
MinRowSpacing="10" />
<!--<WrapLayout
HorizontalSpacing="10"
@@ -506,9 +508,6 @@
<DataTemplate DataType="spp:SteamApp">
<spp:AppItem
Title="{Binding DisplayName}"
Height="340"
MinWidth="128"
MaxWidth="169"
Classes="Vertical"
ContextFlyout="{StaticResource SharedMenuFlyout}"
MoreFlyout="{StaticResource SharedMenuFlyout}">
@@ -518,7 +517,7 @@
</Border>
</spp:AppItem.Status>
<spp:AppItem.Image>
<Panel MinWidth="{ReflectionBinding $parent[spp:AppItem].MinWidth}" MaxWidth="{ReflectionBinding $parent[spp:AppItem].MaxWidth}">
<Panel Width="{ReflectionBinding $parent[spp:AppItem].Bounds.Width}">
<spp:Image2
Name="AppImage"
DecodeWidth="169"
+8 -8
View File
@@ -3531,7 +3531,7 @@ namespace BD.WTTS.Client.Resources {
}
/// <summary>
/// 查找类似 通过使用 Google 添加移动验证器时生成的密钥或二维码导入令牌 的本地化字符串。
/// 查找类似 添加 Google 移动验证器时生成的密钥或二维码导入令牌 的本地化字符串。
/// </summary>
public static string LocalAuth_GoogleImport {
get {
@@ -3540,7 +3540,7 @@ namespace BD.WTTS.Client.Resources {
}
/// <summary>
/// 查找类似 通过使用添加 HOTP、TOTP 移动验证器时生成的通用密钥导入令牌 的本地化字符串。
/// 查找类似 添加 HOTP、TOTP 移动验证器时生成的通用密钥导入令牌 的本地化字符串。
/// </summary>
public static string LocalAuth_HOTPImport {
get {
@@ -3585,7 +3585,7 @@ namespace BD.WTTS.Client.Resources {
}
/// <summary>
/// 查找类似 通过使用 Microsoft 添加移动验证器时生成的密钥或二维码导入令牌 的本地化字符串。
/// 查找类似 添加 Microsoft 移动验证器时生成的密钥或二维码导入令牌 的本地化字符串。
/// </summary>
public static string LocalAuth_MicrosoftImport {
get {
@@ -3793,7 +3793,7 @@ namespace BD.WTTS.Client.Resources {
}
/// <summary>
/// 查找类似 通过使用 Steam 「移动验证器」内的可移植数据导入令牌 的本地化字符串。
/// 查找类似 使用 Steam 「移动验证器」内的可移植数据导入令牌 的本地化字符串。
/// </summary>
public static string LocalAuth_SteamGuardImport {
get {
@@ -3856,7 +3856,7 @@ namespace BD.WTTS.Client.Resources {
}
/// <summary>
/// 查找类似 通过 Steam++ V1 版本工具箱导出的文件导入令牌 的本地化字符串。
/// 查找类似 使用 Steam++ V1 版本工具箱导出的文件导入令牌 的本地化字符串。
/// </summary>
public static string LocalAuth_WattToolKitV1Import {
get {
@@ -3865,7 +3865,7 @@ namespace BD.WTTS.Client.Resources {
}
/// <summary>
/// 查找类似 通过 WattToolKit V2 工具箱导出的文件,导入令牌 的本地化字符串。
/// 查找类似 使用 WattToolKit V2 工具箱导出的文件,导入令牌 的本地化字符串。
/// </summary>
public static string LocalAuth_WattToolKitV2Import {
get {
@@ -3874,7 +3874,7 @@ namespace BD.WTTS.Client.Resources {
}
/// <summary>
/// 查找类似 通过 WinAuth 导出的文件导入令牌 的本地化字符串。
/// 查找类似 使用 WinAuth 导出的文件导入令牌 的本地化字符串。
/// </summary>
public static string LocalAuth_WinAuthImport {
get {
@@ -6101,7 +6101,7 @@ namespace BD.WTTS.Client.Resources {
}
/// <summary>
/// 查找类似 登录 Steam 账号进行令牌导入,导入前需要移除旧令牌,并且此导入方式会有市场交易 15 天冷却期。(如果没有开 Steam 网络加速会导致无法登录成功) 的本地化字符串。
/// 查找类似 登录 Steam 账号进行令牌导入,此导入方式会替换原有令牌,完成导入后 2 天无法交易,如果您未绑定令牌则会有市场交易 15 天冷却期。(请记得启用 Steam 网络加速) 的本地化字符串。
/// </summary>
public static string Steam_UserLoginTip {
get {
+8 -8
View File
@@ -884,7 +884,7 @@
<value>Steam 用户名</value>
</data>
<data name="Steam_UserLoginTip" xml:space="preserve">
<value>登录 Steam 账号进行令牌导入,导入前需要移除旧令牌,并且此导入方式会有市场交易 15 天冷却期。(如果没有开 Steam 网络加速会导致无法登录成功)</value>
<value>登录 Steam 账号进行令牌导入,此导入方式会替换原有令牌,完成导入后 2 天无法交易,如果您未绑定令牌则会有市场交易 15 天冷却期。(请记得启用 Steam 网络加速)</value>
</data>
<data name="Success_" xml:space="preserve">
<value>{0}成功</value>
@@ -2288,22 +2288,22 @@
<value>Steam++ V1</value>
</data>
<data name="LocalAuth_WattToolKitV1Import" xml:space="preserve">
<value>通过 Steam++ V1 版本工具箱导出的文件导入令牌</value>
<value>使用 Steam++ V1 版本工具箱导出的文件导入令牌</value>
</data>
<data name="LocalAuth_WattToolKitV2Import" xml:space="preserve">
<value>通过 WattToolKit V2 工具箱导出的文件,导入令牌</value>
<value>使用 WattToolKit V2 工具箱导出的文件,导入令牌</value>
</data>
<data name="WinAuth" xml:space="preserve">
<value>WinAuth </value>
</data>
<data name="LocalAuth_WinAuthImport" xml:space="preserve">
<value>通过 WinAuth 导出的文件导入令牌</value>
<value>使用 WinAuth 导出的文件导入令牌</value>
</data>
<data name="SteamGuard" xml:space="preserve">
<value>Steam 「移动验证器」</value>
</data>
<data name="LocalAuth_SteamGuardImport" xml:space="preserve">
<value>通过使用 Steam 「移动验证器」内的可移植数据导入令牌</value>
<value>使用 Steam 「移动验证器」内的可移植数据导入令牌</value>
</data>
<data name="LocalAuth_2FAImport" xml:space="preserve">
<value>{0}密钥导入</value>
@@ -2312,19 +2312,19 @@
<value>HOTP、TOTP通用令牌</value>
</data>
<data name="LocalAuth_HOTPImport" xml:space="preserve">
<value>通过使用添加 HOTP、TOTP 移动验证器时生成的通用密钥导入令牌</value>
<value>添加 HOTP、TOTP 移动验证器时生成的通用密钥导入令牌</value>
</data>
<data name="Google" xml:space="preserve">
<value>Google 令牌</value>
</data>
<data name="LocalAuth_GoogleImport" xml:space="preserve">
<value>通过使用 Google 添加移动验证器时生成的密钥或二维码导入令牌</value>
<value>添加 Google 移动验证器时生成的密钥或二维码导入令牌</value>
</data>
<data name="Microsoft" xml:space="preserve">
<value>Microsoft 令牌</value>
</data>
<data name="LocalAuth_MicrosoftImport" xml:space="preserve">
<value>通过使用 Microsoft 添加移动验证器时生成的密钥或二维码导入令牌</value>
<value>添加 Microsoft 移动验证器时生成的密钥或二维码导入令牌</value>
</data>
<data name="LocalAuth_SteamAppImportTip" xml:space="preserve">
<value>新版本 SteamApp 令牌的一些导入方案参考</value>