diff --git a/OsuPlayer.Common/Configuration/GeneralSection.cs b/OsuPlayer.Common/Configuration/GeneralSection.cs index 7821cdf1..2a97738a 100644 --- a/OsuPlayer.Common/Configuration/GeneralSection.cs +++ b/OsuPlayer.Common/Configuration/GeneralSection.cs @@ -13,6 +13,7 @@ public class GeneralSection public string CustomSongsPath { get; set; } = Path.Combine(Domain.CurrentPath, "Songs"); public bool? ExitWhenClosed { get; set; } = null; public bool FirstOpen { get; set; } = true; + public bool IsNavigationCollapsed { get; set; } public Point? MiniLastPosition { get; set; } public Rectangle? MiniWorkingArea { get; set; } } diff --git a/OsuPlayer.Wpf/Converters/GetOutlinedTextConverter.cs b/OsuPlayer.Wpf/Converters/GetOutlinedTextConverter.cs new file mode 100644 index 00000000..01b80b0a --- /dev/null +++ b/OsuPlayer.Wpf/Converters/GetOutlinedTextConverter.cs @@ -0,0 +1,49 @@ +using System; +using System.Globalization; +using System.Linq; +using System.Windows.Data; + +namespace Milky.OsuPlayer.Converters +{ + class GetOutlinedTextConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is string s) + { + string result = null; + var split = s.Split(' '); + if (split.Length > 1) + { + result = (split[0].Substring(0, 1) + split[1].Substring(0, 1)).ToUpper(); + } + else if (split.Length > 0) + { + if (split[0].Length > 1) + { + result = split[0].Substring(0, 2); + } + else + result = split[0].Substring(0, 1); + } + + if (result == null) return null; + if (result.All(k => k >= 32 && k <= 255)) + { + return result; + } + else + { + return result.Substring(0, 1); + } + } + + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/OsuPlayer.Wpf/OsuPlayer.Wpf.csproj b/OsuPlayer.Wpf/OsuPlayer.Wpf.csproj index 9456fa6b..8c8f439c 100644 --- a/OsuPlayer.Wpf/OsuPlayer.Wpf.csproj +++ b/OsuPlayer.Wpf/OsuPlayer.Wpf.csproj @@ -172,6 +172,7 @@ + diff --git a/OsuPlayer.Wpf/Styles/ConverterDictionary.xaml b/OsuPlayer.Wpf/Styles/ConverterDictionary.xaml index db85b6a4..4ac02507 100644 --- a/OsuPlayer.Wpf/Styles/ConverterDictionary.xaml +++ b/OsuPlayer.Wpf/Styles/ConverterDictionary.xaml @@ -22,4 +22,5 @@ + \ No newline at end of file diff --git a/OsuPlayer.Wpf/UiComponents/RadioButtonComponent/SwitchRadio.xaml b/OsuPlayer.Wpf/UiComponents/RadioButtonComponent/SwitchRadio.xaml index 5ec34ab1..1f5bc3e7 100644 --- a/OsuPlayer.Wpf/UiComponents/RadioButtonComponent/SwitchRadio.xaml +++ b/OsuPlayer.Wpf/UiComponents/RadioButtonComponent/SwitchRadio.xaml @@ -140,6 +140,8 @@ + + +