diff --git a/src/BD.WTTS.Client.Avalonia/Converters/StringOmitConverter.cs b/src/BD.WTTS.Client.Avalonia/Converters/StringOmitConverter.cs deleted file mode 100644 index cd5528a6182..00000000000 --- a/src/BD.WTTS.Client.Avalonia/Converters/StringOmitConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BD.WTTS.Converters; - -public sealed class StringOmitConverter : IValueConverter -{ - public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - string s = value.ToString(); - int leng; - if (int.TryParse(parameter.ToString(), out leng)) - { - if (s.Length <= leng) - return s; - else - return s[..leng] + "..."; - } - else - return string.Empty; - } - - public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - throw new NotImplementedException(); - } -} diff --git a/src/BD.WTTS.Client.Avalonia/Converters/VisbleStringConverter.cs b/src/BD.WTTS.Client.Avalonia/Converters/VisibleStringConverter.cs similarity index 86% rename from src/BD.WTTS.Client.Avalonia/Converters/VisbleStringConverter.cs rename to src/BD.WTTS.Client.Avalonia/Converters/VisibleStringConverter.cs index 340098308a6..4cde31f3234 100644 --- a/src/BD.WTTS.Client.Avalonia/Converters/VisbleStringConverter.cs +++ b/src/BD.WTTS.Client.Avalonia/Converters/VisibleStringConverter.cs @@ -1,6 +1,6 @@ namespace BD.WTTS.Converters; -public sealed class VisbleStringConverter : IMultiValueConverter +public sealed class VisibleStringConverter : IMultiValueConverter { public object? Convert(IList values, Type targetType, object? parameter, CultureInfo culture) { diff --git a/src/BD.WTTS.Client.Avalonia/UI/App.TrayIcon.cs b/src/BD.WTTS.Client.Avalonia/UI/App.TrayIcon.cs index 9f605764ab0..924a65a63bd 100644 --- a/src/BD.WTTS.Client.Avalonia/UI/App.TrayIcon.cs +++ b/src/BD.WTTS.Client.Avalonia/UI/App.TrayIcon.cs @@ -88,7 +88,7 @@ public void UpdateMenuItems() new Binding { Path = "Res.CloseSteam", Source = ResourceService.Current, Mode = BindingMode.OneWay }, new Binding { Path = "Res.StartSteam", Source = ResourceService.Current, Mode = BindingMode.OneWay }, }, - Converter = (VisbleStringConverter)App.Instance.FindResource("VisbleStringConverter")!, + Converter = (VisibleStringConverter)App.Instance.FindResource(nameof(VisibleStringConverter))!, }, Command = ReactiveCommand.Create(async () => { diff --git a/src/BD.WTTS.Client.Avalonia/UI/App.axaml b/src/BD.WTTS.Client.Avalonia/UI/App.axaml index f3364e82672..d8e81d216d1 100644 --- a/src/BD.WTTS.Client.Avalonia/UI/App.axaml +++ b/src/BD.WTTS.Client.Avalonia/UI/App.axaml @@ -17,8 +17,7 @@ - - + diff --git a/src/BD.WTTS.Client.Avalonia/UI/Styling/Controls/OptionsDisplayItem.axaml b/src/BD.WTTS.Client.Avalonia/UI/Styling/Controls/OptionsDisplayItem.axaml index c4a2fab5eb9..d5ddd948bf4 100644 --- a/src/BD.WTTS.Client.Avalonia/UI/Styling/Controls/OptionsDisplayItem.axaml +++ b/src/BD.WTTS.Client.Avalonia/UI/Styling/Controls/OptionsDisplayItem.axaml @@ -59,12 +59,10 @@ - + - - HeaderProperty = - AvaloniaProperty.Register(nameof(Header)); + public static readonly StyledProperty HeaderProperty = + AvaloniaProperty.Register(nameof(Header)); - public static readonly StyledProperty DescriptionProperty = - AvaloniaProperty.Register(nameof(Description)); + public static readonly StyledProperty DescriptionProperty = + AvaloniaProperty.Register(nameof(Description)); public static readonly StyledProperty IconProperty = AvaloniaProperty.Register(nameof(Icon)); @@ -29,13 +31,13 @@ public class OptionsDisplayItem : TemplatedControl public static readonly StyledProperty NavigationCommandProperty = AvaloniaProperty.Register(nameof(NavigationCommand)); - public string Header + public object? Header { get => GetValue(HeaderProperty); set => SetValue(HeaderProperty, value); } - public string Description + public object? Description { get => GetValue(DescriptionProperty); set => SetValue(DescriptionProperty, value); @@ -112,7 +114,7 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang } else if (change.Property == DescriptionProperty) { - PseudoClasses.Set(":desc", !string.IsNullOrEmpty(change.GetNewValue())); + PseudoClasses.Set(":desc", change.GetNewValue() != null); } else if (change.Property == IsExpandedProperty) PseudoClasses.Set(":expanded", change.GetNewValue()); diff --git a/src/BD.WTTS.Client.Plugins.ArchiSteamFarmPlus/UI/Views/Pages/ArchiSteamFarmPage.axaml b/src/BD.WTTS.Client.Plugins.ArchiSteamFarmPlus/UI/Views/Pages/ArchiSteamFarmPage.axaml index fc75069be02..a6ceae0e00b 100644 --- a/src/BD.WTTS.Client.Plugins.ArchiSteamFarmPlus/UI/Views/Pages/ArchiSteamFarmPage.axaml +++ b/src/BD.WTTS.Client.Plugins.ArchiSteamFarmPlus/UI/Views/Pages/ArchiSteamFarmPage.axaml @@ -150,7 +150,14 @@ - + + + + diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs index 55e068c0976..391af207917 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs @@ -12,6 +12,9 @@ public sealed partial class IdleCardPageViewModel public ICommand IdleManualRunNext { get; } + [Reactive] + public bool IsLogin { get; set; } + [Reactive] public bool IsLoaing { get; set; } diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml index 7bcf726e756..18bbeed299e 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml @@ -216,10 +216,45 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -294,7 +329,7 @@ ItemsJustification="Start" ItemsStretch="Uniform" MinColumnSpacing="5" - MinItemHeight="150" + MinItemHeight="160" MinItemWidth="280" MinRowSpacing="5" /> diff --git a/src/BD.WTTS.Client/Resources/Strings.Designer.cs b/src/BD.WTTS.Client/Resources/Strings.Designer.cs index 9e351c01802..4c5c1ecc454 100644 --- a/src/BD.WTTS.Client/Resources/Strings.Designer.cs +++ b/src/BD.WTTS.Client/Resources/Strings.Designer.cs @@ -6937,6 +6937,24 @@ public static string SteamLoginImport { } } + /// + /// 查找类似 Steam 未启动 的本地化字符串。 + /// + public static string SteamNoRuning { + get { + return ResourceManager.GetString("SteamNoRuning", resourceCulture); + } + } + + /// + /// 查找类似 Steam 已启动 的本地化字符串。 + /// + public static string SteamRuning { + get { + return ResourceManager.GetString("SteamRuning", resourceCulture); + } + } + /// /// 查找类似 Steam UUID 的本地化字符串。 /// diff --git a/src/BD.WTTS.Client/Resources/Strings.resx b/src/BD.WTTS.Client/Resources/Strings.resx index e6059732f61..17980eb148e 100644 --- a/src/BD.WTTS.Client/Resources/Strings.resx +++ b/src/BD.WTTS.Client/Resources/Strings.resx @@ -2849,5 +2849,11 @@ 已游玩 {0} 小时 {1} 张剩余卡牌掉落 + + + Steam 已启动 + + + Steam 未启动 \ No newline at end of file