mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Rework Appearance tab of menu (and other things)
This commit is contained in:
parent
e9d8dc3ae4
commit
f564e409ba
@ -16,16 +16,24 @@ namespace Bloxstrap.Extensions
|
||||
if (icon == BootstrapperIcon.IconCustom)
|
||||
{
|
||||
Icon? customIcon = null;
|
||||
string location = App.Settings.Prop.BootstrapperIconCustomLocation;
|
||||
|
||||
if (String.IsNullOrEmpty(location))
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, "Warning: custom icon is not set.");
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
customIcon = new Icon(App.Settings.Prop.BootstrapperIconCustomLocation);
|
||||
customIcon = new Icon(location);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Failed to load custom icon!");
|
||||
App.Logger.WriteException(LOG_IDENT, ex);
|
||||
}
|
||||
}
|
||||
|
||||
return customIcon ?? Properties.Resources.IconBloxstrap;
|
||||
}
|
||||
|
11
Bloxstrap/Models/BootstrapperIconEntry.cs
Normal file
11
Bloxstrap/Models/BootstrapperIconEntry.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Bloxstrap.Models
|
||||
{
|
||||
public class BootstrapperIconEntry
|
||||
{
|
||||
public BootstrapperIcon IconType { get; set; }
|
||||
public string Name => IconType.ToString();
|
||||
public ImageSource ImageSource => IconType.GetIcon().GetImageSource();
|
||||
}
|
||||
}
|
62
Bloxstrap/Resources/Strings.Designer.cs
generated
62
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -1435,7 +1435,25 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Configure other customisable Bootstrapper options..
|
||||
/// Looks up a localized string similar to You can make it look different, retro, or even just like Roblox..
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Bootstrapper_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Appearance.Bootstrapper.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bootstrapper.
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Bootstrapper_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Appearance.Bootstrapper.Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Configure other miscellaneous customisable options..
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Customisation_Description {
|
||||
get {
|
||||
@ -1444,7 +1462,7 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bootstrapper customisation.
|
||||
/// Looks up a localized string similar to Customisation.
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Customisation_Title {
|
||||
get {
|
||||
@ -1498,7 +1516,25 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Choose what icon the bootstrapper should use..
|
||||
/// Looks up a localized string similar to Dark theme does not apply to Legacy or Vista styles..
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Global_Theme_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Appearance.Global.Theme.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Global Theme.
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Global_Theme_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Appearance.Global.Theme.Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Choose what icon it should use..
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Icon_Description {
|
||||
get {
|
||||
@ -1525,7 +1561,7 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Choose how the bootstrapper should look..
|
||||
/// Looks up a localized string similar to Choose how it should look. Dark theme does not apply to Legacy/Vista..
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Style_Description {
|
||||
get {
|
||||
@ -1542,24 +1578,6 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Dark theme does not apply to Legacy or Vista styles..
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Theme_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Appearance.Theme.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Theme.
|
||||
/// </summary>
|
||||
public static string Menu_Appearance_Theme_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Appearance.Theme.Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Appearance.
|
||||
/// </summary>
|
||||
|
@ -579,11 +579,17 @@ Would you like to upgrade your currently installed version?</value>
|
||||
<data name="Menu.AlreadyRunning" xml:space="preserve">
|
||||
<value>Bloxstrap is currently running, likely as a background Roblox process. Please note that not all your changes will immediately apply until you close all currently open Roblox instances."</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Bootstrapper.Description" xml:space="preserve">
|
||||
<value>You can make it look different, retro, or even just like Roblox.</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Bootstrapper.Title" xml:space="preserve">
|
||||
<value>Bootstrapper</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Customisation.Description" xml:space="preserve">
|
||||
<value>Configure other customisable Bootstrapper options.</value>
|
||||
<value>Configure other miscellaneous customisable options.</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Customisation.Title" xml:space="preserve">
|
||||
<value>Bootstrapper customisation</value>
|
||||
<value>Customisation</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.CustomisationIcon.Description" xml:space="preserve">
|
||||
<value>Must be a multi-size .ico file with sizes 16px to 128px. Set Icon as 'Custom' to use it.</value>
|
||||
@ -600,8 +606,14 @@ Would you like to upgrade your currently installed version?</value>
|
||||
<data name="Menu.Appearance.Description" xml:space="preserve">
|
||||
<value>Configure how Bloxstrap should look.</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Global.Theme.Description" xml:space="preserve">
|
||||
<value>Dark theme does not apply to Legacy or Vista styles.</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Global.Theme.Title" xml:space="preserve">
|
||||
<value>Global Theme</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Icon.Description" xml:space="preserve">
|
||||
<value>Choose what icon the bootstrapper should use.</value>
|
||||
<value>Choose what icon it should use.</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Icon.Title" xml:space="preserve">
|
||||
<value>Icon</value>
|
||||
@ -610,17 +622,11 @@ Would you like to upgrade your currently installed version?</value>
|
||||
<value>Preview</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Style.Description" xml:space="preserve">
|
||||
<value>Choose how the bootstrapper should look.</value>
|
||||
<value>Choose how it should look. Dark theme does not apply to Legacy/Vista.</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Style.Title" xml:space="preserve">
|
||||
<value>Style</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Theme.Description" xml:space="preserve">
|
||||
<value>Dark theme does not apply to Legacy or Vista styles.</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Theme.Title" xml:space="preserve">
|
||||
<value>Theme</value>
|
||||
</data>
|
||||
<data name="Menu.Appearance.Title" xml:space="preserve">
|
||||
<value>Appearance</value>
|
||||
</data>
|
||||
|
@ -17,23 +17,9 @@ namespace Bloxstrap.UI.Elements.Controls
|
||||
[Localizability(LocalizationCategory.Text)]
|
||||
class MarkdownTextBlock : TextBlock
|
||||
{
|
||||
public static readonly DependencyProperty MarkdownTextProperty = DependencyProperty.Register(
|
||||
"MarkdownText",
|
||||
typeof(string),
|
||||
typeof(MarkdownTextBlock),
|
||||
new FrameworkPropertyMetadata(
|
||||
string.Empty,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
|
||||
OnTextMarkdownChanged));
|
||||
|
||||
public MarkdownTextBlock(string markdownText)
|
||||
{
|
||||
MarkdownText = markdownText;
|
||||
}
|
||||
|
||||
public MarkdownTextBlock()
|
||||
{
|
||||
}
|
||||
public static readonly DependencyProperty MarkdownTextProperty =
|
||||
DependencyProperty.Register(nameof(MarkdownText), typeof(string), typeof(MarkdownTextBlock),
|
||||
new FrameworkPropertyMetadata(string.Empty,FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnTextMarkdownChanged));
|
||||
|
||||
[Localizability(LocalizationCategory.Text)]
|
||||
public string MarkdownText
|
||||
@ -44,12 +30,13 @@ namespace Bloxstrap.UI.Elements.Controls
|
||||
|
||||
private static void OnTextMarkdownChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
|
||||
{
|
||||
var markdownTextBlock = dependencyObject as MarkdownTextBlock;
|
||||
|
||||
if (markdownTextBlock == null)
|
||||
if (dependencyObject is not MarkdownTextBlock markdownTextBlock)
|
||||
return;
|
||||
|
||||
MarkdownDocument document = Markdown.Parse((string)dependencyPropertyChangedEventArgs.NewValue);
|
||||
if (dependencyPropertyChangedEventArgs.NewValue is not string rawDocument)
|
||||
return;
|
||||
|
||||
MarkdownDocument document = Markdown.Parse(rawDocument);
|
||||
|
||||
markdownTextBlock.Inlines.Clear();
|
||||
|
||||
|
@ -48,7 +48,17 @@
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<local:MarkdownTextBlock Margin="0,2,0,0" FontSize="12" MarkdownText="{Binding Description, ElementName=Control}" Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||
<local:MarkdownTextBlock Margin="0,2,0,0" FontSize="12" MarkdownText="{Binding Description, ElementName=Control}" Foreground="{DynamicResource TextFillColorTertiaryBrush}">
|
||||
<local:MarkdownTextBlock.Style>
|
||||
<Style TargetType="local:MarkdownTextBlock">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Description, ElementName=Control}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</local:MarkdownTextBlock.Style>
|
||||
</local:MarkdownTextBlock>
|
||||
</StackPanel>
|
||||
</ui:CardControl.Header>
|
||||
</ui:CardControl>
|
||||
|
@ -37,9 +37,7 @@ namespace Bloxstrap.UI.Elements.Dialogs
|
||||
|
||||
ReportOptions.DropDownClosed += (sender, e) =>
|
||||
{
|
||||
ComboBoxItem? comboBoxItem = ReportOptions.SelectedItem as ComboBoxItem;
|
||||
|
||||
if (comboBoxItem is null)
|
||||
if (ReportOptions.SelectedItem is not ComboBoxItem comboBoxItem)
|
||||
return;
|
||||
|
||||
ReportOptions.SelectedIndex = 0;
|
||||
|
@ -1,10 +1,6 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
using Wpf.Ui.Appearance;
|
||||
using Wpf.Ui.Controls.Interfaces;
|
||||
using Wpf.Ui.Mvvm.Contracts;
|
||||
using Wpf.Ui.Mvvm.Services;
|
||||
|
||||
using Bloxstrap.UI.ViewModels.Menu;
|
||||
|
||||
namespace Bloxstrap.UI.Elements.Menu
|
||||
|
@ -11,11 +11,10 @@
|
||||
Title="AppearancePage"
|
||||
Scrollable="True">
|
||||
<StackPanel Margin="0,0,14,14">
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Appearance_Description}" FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Appearance_Description}" FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" Margin="0,0,0,8" />
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Appearance_Theme_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Appearance_Theme_Description}">
|
||||
Header="{x:Static resources:Strings.Menu_Appearance_Global_Theme_Title}">
|
||||
<ComboBox Width="200" Padding="10,5,10,5" ItemsSource="{Binding Themes, Mode=OneTime}" Text="{Binding Theme, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@ -25,6 +24,18 @@
|
||||
</ComboBox>
|
||||
</controls:OptionControl>
|
||||
|
||||
<Grid Margin="0,4,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="128" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" VerticalAlignment="Bottom">
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Appearance_Bootstrapper_Title}" FontSize="16" FontWeight="Medium" VerticalAlignment="Bottom" />
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Appearance_Bootstrapper_Description}" TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
</StackPanel>
|
||||
<ui:Button Grid.Column="1" Content="{x:Static resources:Strings.Menu_Appearance_Preview}" HorizontalAlignment="Stretch" Margin="0,16,0,0" Command="{Binding PreviewBootstrapperCommand}" />
|
||||
</Grid>
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Appearance_Style_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Appearance_Style_Description}">
|
||||
@ -38,26 +49,23 @@
|
||||
</controls:OptionControl>
|
||||
|
||||
<controls:OptionControl
|
||||
x:Name="IconSelector"
|
||||
Header="{x:Static resources:Strings.Menu_Appearance_Icon_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Appearance_Icon_Description}">
|
||||
<Grid Width="200">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Grid.Column="0" Width="28" Height="28" Margin="0,0,5,0">
|
||||
<Border.Background>
|
||||
<ImageBrush ImageSource="{Binding IconPreviewSource, Mode=OneWay}" />
|
||||
</Border.Background>
|
||||
</Border>
|
||||
<ComboBox Grid.Column="1" Margin="5,0,0,0" Padding="10,5,10,5" ItemsSource="{Binding Icons, Mode=OneTime}" Text="{Binding Icon, Mode=TwoWay}">
|
||||
<ComboBox Width="200" Padding="10,5,10,5" ItemsSource="{Binding Icons, Mode=OneWay}" SelectedValuePath="IconType" SelectedValue="{Binding Icon, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=., Converter={StaticResource ResourceConverter}, ConverterParameter='Enums.BootstrapperIcon.'}" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="16" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Height="16" Source="{Binding ImageSource, Mode=OneWay}" RenderOptions.BitmapScalingMode="HighQuality" />
|
||||
<TextBlock Grid.Column="1" Margin="8,0,0,0" Text="{Binding Name, Mode=OneWay, Converter={StaticResource ResourceConverter}, ConverterParameter='Enums.BootstrapperIcon.'}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</controls:OptionControl>
|
||||
|
||||
<ui:CardExpander Margin="0,8,0,0" IsExpanded="False">
|
||||
@ -69,7 +77,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock FontSize="14" Text="{x:Static resources:Strings.Menu_Appearance_Customisation_Title}" />
|
||||
<TextBlock Margin="0,2,0,0" FontSize="12" Text="{x:Static resources:Strings.Menu_Appearance_Customisation_Description}" Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||
<TextBlock FontSize="12" Text="{x:Static resources:Strings.Menu_Appearance_Customisation_Description}" Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ui:CardExpander.Header>
|
||||
@ -94,12 +102,11 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Grid.Column="0" Margin="0,0,4,0" Text="{Binding CustomIconLocation, Mode=TwoWay}" />
|
||||
<ui:TextBox Grid.Column="0" Margin="0,0,4,0" Text="{Binding CustomIconLocation, Mode=TwoWay}" />
|
||||
<ui:Button Grid.Column="1" Margin="4,0,0,0" Height="35" Icon="Folder24" Content="{x:Static resources:Strings.Common_Browse}" Command="{Binding BrowseCustomIconLocationCommand}" />
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Margin="0,4,0,0" FontSize="12" Text="{x:Static resources:Strings.Menu_Appearance_CustomisationIcon_Description}" Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||
</Grid>
|
||||
</ui:CardExpander>
|
||||
<ui:Button Content="{x:Static resources:Strings.Menu_Appearance_Preview}" HorizontalAlignment="Stretch" Margin="0,8,0,0" Command="{Binding PreviewBootstrapperCommand}" />
|
||||
</StackPanel>
|
||||
</ui:UiPage>
|
||||
|
@ -59,7 +59,7 @@
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{x:Static resources:Strings.Common_Presets}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
||||
<controls:MarkdownTextBlock MarkdownText="{Binding Source={x:Static resources:Strings.Menu_FastFlags_Presets_D3DExclusiveFullscreenInfo}, Converter={StaticResource StringFormatConverter}, ConverterParameter='https://github.com/pizzaboxer/bloxstrap/wiki/A-guide-to-FastFlags#exclusive-fullscreen'}" />
|
||||
<controls:MarkdownTextBlock MarkdownText="{Binding Source={x:Static resources:Strings.Menu_FastFlags_Presets_D3DExclusiveFullscreenInfo}, Converter={StaticResource StringFormatConverter}, ConverterParameter='https://github.com/pizzaboxer/bloxstrap/wiki/A-guide-to-FastFlags#exclusive-fullscreen'}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_FastFlags_Presets_FPSLimit_Title}"
|
||||
|
@ -33,7 +33,7 @@
|
||||
</controls:OptionControl>
|
||||
|
||||
<TextBlock Text="{x:Static resources:Strings.Common_DiscordRichPresence}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
||||
<TextBlock Margin="0,4,0,0" Text="{x:Static resources:Strings.Menu_Integrations_RequiresActivityTracking}" TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Integrations_RequiresActivityTracking}" TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Integrations_ShowGameActivity_Title}"
|
||||
@ -59,7 +59,7 @@
|
||||
</controls:OptionControl>
|
||||
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Integrations_Custom_Title}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
||||
<TextBlock Margin="0,4,0,0" Text="{x:Static resources:Strings.Menu_Integrations_Custom_Description}" TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
<TextBlock Text="{x:Static resources:Strings.Menu_Integrations_Custom_Description}" TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
<Grid Margin="0,8,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Windows;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
@ -48,14 +48,12 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
public AppearanceViewModel(Page page)
|
||||
{
|
||||
_page = page;
|
||||
|
||||
foreach (var entry in Enum.GetValues(typeof(BootstrapperIcon)).Cast<BootstrapperIcon>())
|
||||
Icons.Add(new BootstrapperIconEntry { IconType = entry });
|
||||
}
|
||||
|
||||
public IReadOnlyCollection<Theme> Themes { get; set; } = new Theme[]
|
||||
{
|
||||
Theme.Default,
|
||||
Theme.Light,
|
||||
Theme.Dark
|
||||
};
|
||||
public IEnumerable<Theme> Themes { get; } = Enum.GetValues(typeof(Theme)).Cast<Theme>();
|
||||
|
||||
public Theme Theme
|
||||
{
|
||||
@ -67,15 +65,7 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public IReadOnlyCollection<BootstrapperStyle> Dialogs { get; set; } = new BootstrapperStyle[]
|
||||
{
|
||||
BootstrapperStyle.FluentDialog,
|
||||
BootstrapperStyle.ProgressDialog,
|
||||
BootstrapperStyle.LegacyDialog2011,
|
||||
BootstrapperStyle.LegacyDialog2008,
|
||||
BootstrapperStyle.VistaDialog,
|
||||
BootstrapperStyle.ByfronDialog
|
||||
};
|
||||
public IEnumerable<BootstrapperStyle> Dialogs { get; } = Enum.GetValues(typeof(BootstrapperStyle)).Cast<BootstrapperStyle>();
|
||||
|
||||
public BootstrapperStyle Dialog
|
||||
{
|
||||
@ -83,30 +73,13 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
set => App.Settings.Prop.BootstrapperStyle = value;
|
||||
}
|
||||
|
||||
public IReadOnlyCollection<BootstrapperIcon> Icons { get; set; } = new BootstrapperIcon[]
|
||||
{
|
||||
BootstrapperIcon.IconBloxstrap,
|
||||
BootstrapperIcon.Icon2022,
|
||||
BootstrapperIcon.Icon2019,
|
||||
BootstrapperIcon.Icon2017,
|
||||
BootstrapperIcon.IconLate2015,
|
||||
BootstrapperIcon.IconEarly2015,
|
||||
BootstrapperIcon.Icon2011,
|
||||
BootstrapperIcon.Icon2008,
|
||||
BootstrapperIcon.IconCustom
|
||||
};
|
||||
public ObservableCollection<BootstrapperIconEntry> Icons { get; set; } = new();
|
||||
|
||||
public BootstrapperIcon Icon
|
||||
{
|
||||
get => App.Settings.Prop.BootstrapperIcon;
|
||||
set
|
||||
{
|
||||
App.Settings.Prop.BootstrapperIcon = value;
|
||||
OnPropertyChanged(nameof(IconPreviewSource));
|
||||
set => App.Settings.Prop.BootstrapperIcon = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ImageSource IconPreviewSource => App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource();
|
||||
|
||||
public string Title
|
||||
{
|
||||
@ -118,12 +91,21 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
{
|
||||
get => App.Settings.Prop.BootstrapperIconCustomLocation;
|
||||
set
|
||||
{
|
||||
if (String.IsNullOrEmpty(value))
|
||||
{
|
||||
if (App.Settings.Prop.BootstrapperIcon == BootstrapperIcon.IconCustom)
|
||||
App.Settings.Prop.BootstrapperIcon = BootstrapperIcon.IconBloxstrap;
|
||||
}
|
||||
else
|
||||
{
|
||||
App.Settings.Prop.BootstrapperIcon = BootstrapperIcon.IconCustom;
|
||||
}
|
||||
|
||||
App.Settings.Prop.BootstrapperIconCustomLocation = value;
|
||||
|
||||
OnPropertyChanged(nameof(Icon));
|
||||
OnPropertyChanged(nameof(IconPreviewSource));
|
||||
OnPropertyChanged(nameof(Icons));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user