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,15 +16,23 @@ namespace Bloxstrap.Extensions
|
|||||||
if (icon == BootstrapperIcon.IconCustom)
|
if (icon == BootstrapperIcon.IconCustom)
|
||||||
{
|
{
|
||||||
Icon? customIcon = null;
|
Icon? customIcon = null;
|
||||||
|
string location = App.Settings.Prop.BootstrapperIconCustomLocation;
|
||||||
|
|
||||||
try
|
if (String.IsNullOrEmpty(location))
|
||||||
{
|
{
|
||||||
customIcon = new Icon(App.Settings.Prop.BootstrapperIconCustomLocation);
|
App.Logger.WriteLine(LOG_IDENT, "Warning: custom icon is not set.");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
else
|
||||||
{
|
{
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Failed to load custom icon!");
|
try
|
||||||
App.Logger.WriteException(LOG_IDENT, ex);
|
{
|
||||||
|
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;
|
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>
|
/// <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>
|
/// </summary>
|
||||||
public static string Menu_Appearance_Customisation_Description {
|
public static string Menu_Appearance_Customisation_Description {
|
||||||
get {
|
get {
|
||||||
@ -1444,7 +1462,7 @@ namespace Bloxstrap.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Bootstrapper customisation.
|
/// Looks up a localized string similar to Customisation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string Menu_Appearance_Customisation_Title {
|
public static string Menu_Appearance_Customisation_Title {
|
||||||
get {
|
get {
|
||||||
@ -1498,7 +1516,25 @@ namespace Bloxstrap.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public static string Menu_Appearance_Icon_Description {
|
public static string Menu_Appearance_Icon_Description {
|
||||||
get {
|
get {
|
||||||
@ -1525,7 +1561,7 @@ namespace Bloxstrap.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public static string Menu_Appearance_Style_Description {
|
public static string Menu_Appearance_Style_Description {
|
||||||
get {
|
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>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Appearance.
|
/// Looks up a localized string similar to Appearance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -579,11 +579,17 @@ Would you like to upgrade your currently installed version?</value>
|
|||||||
<data name="Menu.AlreadyRunning" xml:space="preserve">
|
<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>
|
<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>
|
||||||
|
<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">
|
<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>
|
||||||
<data name="Menu.Appearance.Customisation.Title" xml:space="preserve">
|
<data name="Menu.Appearance.Customisation.Title" xml:space="preserve">
|
||||||
<value>Bootstrapper customisation</value>
|
<value>Customisation</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Menu.Appearance.CustomisationIcon.Description" xml:space="preserve">
|
<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>
|
<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">
|
<data name="Menu.Appearance.Description" xml:space="preserve">
|
||||||
<value>Configure how Bloxstrap should look.</value>
|
<value>Configure how Bloxstrap should look.</value>
|
||||||
</data>
|
</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">
|
<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>
|
||||||
<data name="Menu.Appearance.Icon.Title" xml:space="preserve">
|
<data name="Menu.Appearance.Icon.Title" xml:space="preserve">
|
||||||
<value>Icon</value>
|
<value>Icon</value>
|
||||||
@ -610,17 +622,11 @@ Would you like to upgrade your currently installed version?</value>
|
|||||||
<value>Preview</value>
|
<value>Preview</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Menu.Appearance.Style.Description" xml:space="preserve">
|
<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>
|
||||||
<data name="Menu.Appearance.Style.Title" xml:space="preserve">
|
<data name="Menu.Appearance.Style.Title" xml:space="preserve">
|
||||||
<value>Style</value>
|
<value>Style</value>
|
||||||
</data>
|
</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">
|
<data name="Menu.Appearance.Title" xml:space="preserve">
|
||||||
<value>Appearance</value>
|
<value>Appearance</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -17,23 +17,9 @@ namespace Bloxstrap.UI.Elements.Controls
|
|||||||
[Localizability(LocalizationCategory.Text)]
|
[Localizability(LocalizationCategory.Text)]
|
||||||
class MarkdownTextBlock : TextBlock
|
class MarkdownTextBlock : TextBlock
|
||||||
{
|
{
|
||||||
public static readonly DependencyProperty MarkdownTextProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty MarkdownTextProperty =
|
||||||
"MarkdownText",
|
DependencyProperty.Register(nameof(MarkdownText), typeof(string), typeof(MarkdownTextBlock),
|
||||||
typeof(string),
|
new FrameworkPropertyMetadata(string.Empty,FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnTextMarkdownChanged));
|
||||||
typeof(MarkdownTextBlock),
|
|
||||||
new FrameworkPropertyMetadata(
|
|
||||||
string.Empty,
|
|
||||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
|
|
||||||
OnTextMarkdownChanged));
|
|
||||||
|
|
||||||
public MarkdownTextBlock(string markdownText)
|
|
||||||
{
|
|
||||||
MarkdownText = markdownText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MarkdownTextBlock()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[Localizability(LocalizationCategory.Text)]
|
[Localizability(LocalizationCategory.Text)]
|
||||||
public string MarkdownText
|
public string MarkdownText
|
||||||
@ -44,12 +30,13 @@ namespace Bloxstrap.UI.Elements.Controls
|
|||||||
|
|
||||||
private static void OnTextMarkdownChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
|
private static void OnTextMarkdownChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
|
||||||
{
|
{
|
||||||
var markdownTextBlock = dependencyObject as MarkdownTextBlock;
|
if (dependencyObject is not MarkdownTextBlock markdownTextBlock)
|
||||||
|
|
||||||
if (markdownTextBlock == null)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MarkdownDocument document = Markdown.Parse((string)dependencyPropertyChangedEventArgs.NewValue);
|
if (dependencyPropertyChangedEventArgs.NewValue is not string rawDocument)
|
||||||
|
return;
|
||||||
|
|
||||||
|
MarkdownDocument document = Markdown.Parse(rawDocument);
|
||||||
|
|
||||||
markdownTextBlock.Inlines.Clear();
|
markdownTextBlock.Inlines.Clear();
|
||||||
|
|
||||||
|
@ -48,7 +48,17 @@
|
|||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</Grid>
|
</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>
|
</StackPanel>
|
||||||
</ui:CardControl.Header>
|
</ui:CardControl.Header>
|
||||||
</ui:CardControl>
|
</ui:CardControl>
|
||||||
|
@ -37,9 +37,7 @@ namespace Bloxstrap.UI.Elements.Dialogs
|
|||||||
|
|
||||||
ReportOptions.DropDownClosed += (sender, e) =>
|
ReportOptions.DropDownClosed += (sender, e) =>
|
||||||
{
|
{
|
||||||
ComboBoxItem? comboBoxItem = ReportOptions.SelectedItem as ComboBoxItem;
|
if (ReportOptions.SelectedItem is not ComboBoxItem comboBoxItem)
|
||||||
|
|
||||||
if (comboBoxItem is null)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ReportOptions.SelectedIndex = 0;
|
ReportOptions.SelectedIndex = 0;
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
using Wpf.Ui.Appearance;
|
|
||||||
using Wpf.Ui.Controls.Interfaces;
|
using Wpf.Ui.Controls.Interfaces;
|
||||||
using Wpf.Ui.Mvvm.Contracts;
|
using Wpf.Ui.Mvvm.Contracts;
|
||||||
using Wpf.Ui.Mvvm.Services;
|
|
||||||
|
|
||||||
using Bloxstrap.UI.ViewModels.Menu;
|
using Bloxstrap.UI.ViewModels.Menu;
|
||||||
|
|
||||||
namespace Bloxstrap.UI.Elements.Menu
|
namespace Bloxstrap.UI.Elements.Menu
|
||||||
|
@ -11,11 +11,10 @@
|
|||||||
Title="AppearancePage"
|
Title="AppearancePage"
|
||||||
Scrollable="True">
|
Scrollable="True">
|
||||||
<StackPanel Margin="0,0,14,14">
|
<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
|
<controls:OptionControl
|
||||||
Header="{x:Static resources:Strings.Menu_Appearance_Theme_Title}"
|
Header="{x:Static resources:Strings.Menu_Appearance_Global_Theme_Title}">
|
||||||
Description="{x:Static resources:Strings.Menu_Appearance_Theme_Description}">
|
|
||||||
<ComboBox Width="200" Padding="10,5,10,5" ItemsSource="{Binding Themes, Mode=OneTime}" Text="{Binding Theme, Mode=TwoWay}">
|
<ComboBox Width="200" Padding="10,5,10,5" ItemsSource="{Binding Themes, Mode=OneTime}" Text="{Binding Theme, Mode=TwoWay}">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@ -25,6 +24,18 @@
|
|||||||
</ComboBox>
|
</ComboBox>
|
||||||
</controls:OptionControl>
|
</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
|
<controls:OptionControl
|
||||||
Header="{x:Static resources:Strings.Menu_Appearance_Style_Title}"
|
Header="{x:Static resources:Strings.Menu_Appearance_Style_Title}"
|
||||||
Description="{x:Static resources:Strings.Menu_Appearance_Style_Description}">
|
Description="{x:Static resources:Strings.Menu_Appearance_Style_Description}">
|
||||||
@ -38,26 +49,23 @@
|
|||||||
</controls:OptionControl>
|
</controls:OptionControl>
|
||||||
|
|
||||||
<controls:OptionControl
|
<controls:OptionControl
|
||||||
|
x:Name="IconSelector"
|
||||||
Header="{x:Static resources:Strings.Menu_Appearance_Icon_Title}"
|
Header="{x:Static resources:Strings.Menu_Appearance_Icon_Title}"
|
||||||
Description="{x:Static resources:Strings.Menu_Appearance_Icon_Description}">
|
Description="{x:Static resources:Strings.Menu_Appearance_Icon_Description}">
|
||||||
<Grid Width="200">
|
<ComboBox Width="200" Padding="10,5,10,5" ItemsSource="{Binding Icons, Mode=OneWay}" SelectedValuePath="IconType" SelectedValue="{Binding Icon, Mode=TwoWay}">
|
||||||
<Grid.ColumnDefinitions>
|
<ComboBox.ItemTemplate>
|
||||||
<ColumnDefinition Width="Auto" />
|
<DataTemplate>
|
||||||
<ColumnDefinition Width="*" />
|
<Grid>
|
||||||
</Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<Border Grid.Column="0" Width="28" Height="28" Margin="0,0,5,0">
|
<ColumnDefinition Width="16" />
|
||||||
<Border.Background>
|
<ColumnDefinition Width="*" />
|
||||||
<ImageBrush ImageSource="{Binding IconPreviewSource, Mode=OneWay}" />
|
</Grid.ColumnDefinitions>
|
||||||
</Border.Background>
|
<Image Height="16" Source="{Binding ImageSource, Mode=OneWay}" RenderOptions.BitmapScalingMode="HighQuality" />
|
||||||
</Border>
|
<TextBlock Grid.Column="1" Margin="8,0,0,0" Text="{Binding Name, Mode=OneWay, Converter={StaticResource ResourceConverter}, ConverterParameter='Enums.BootstrapperIcon.'}" />
|
||||||
<ComboBox Grid.Column="1" Margin="5,0,0,0" Padding="10,5,10,5" ItemsSource="{Binding Icons, Mode=OneTime}" Text="{Binding Icon, Mode=TwoWay}">
|
</Grid>
|
||||||
<ComboBox.ItemTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
<TextBlock Text="{Binding Path=., Converter={StaticResource ResourceConverter}, ConverterParameter='Enums.BootstrapperIcon.'}" />
|
</ComboBox>
|
||||||
</DataTemplate>
|
|
||||||
</ComboBox.ItemTemplate>
|
|
||||||
</ComboBox>
|
|
||||||
</Grid>
|
|
||||||
</controls:OptionControl>
|
</controls:OptionControl>
|
||||||
|
|
||||||
<ui:CardExpander Margin="0,8,0,0" IsExpanded="False">
|
<ui:CardExpander Margin="0,8,0,0" IsExpanded="False">
|
||||||
@ -69,7 +77,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel Grid.Column="0">
|
<StackPanel Grid.Column="0">
|
||||||
<TextBlock FontSize="14" Text="{x:Static resources:Strings.Menu_Appearance_Customisation_Title}" />
|
<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>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ui:CardExpander.Header>
|
</ui:CardExpander.Header>
|
||||||
@ -94,12 +102,11 @@
|
|||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</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}" />
|
<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>
|
</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}" />
|
<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>
|
</Grid>
|
||||||
</ui:CardExpander>
|
</ui:CardExpander>
|
||||||
<ui:Button Content="{x:Static resources:Strings.Menu_Appearance_Preview}" HorizontalAlignment="Stretch" Margin="0,8,0,0" Command="{Binding PreviewBootstrapperCommand}" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ui:UiPage>
|
</ui:UiPage>
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<TextBlock Text="{x:Static resources:Strings.Common_Presets}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
<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
|
<controls:OptionControl
|
||||||
Header="{x:Static resources:Strings.Menu_FastFlags_Presets_FPSLimit_Title}"
|
Header="{x:Static resources:Strings.Menu_FastFlags_Presets_FPSLimit_Title}"
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
</controls:OptionControl>
|
</controls:OptionControl>
|
||||||
|
|
||||||
<TextBlock Text="{x:Static resources:Strings.Common_DiscordRichPresence}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
<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
|
<controls:OptionControl
|
||||||
Header="{x:Static resources:Strings.Menu_Integrations_ShowGameActivity_Title}"
|
Header="{x:Static resources:Strings.Menu_Integrations_ShowGameActivity_Title}"
|
||||||
@ -59,7 +59,7 @@
|
|||||||
</controls:OptionControl>
|
</controls:OptionControl>
|
||||||
|
|
||||||
<TextBlock Text="{x:Static resources:Strings.Menu_Integrations_Custom_Title}" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
|
<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 Margin="0,8,0,0">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
|
||||||
@ -48,14 +48,12 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
|||||||
public AppearanceViewModel(Page page)
|
public AppearanceViewModel(Page page)
|
||||||
{
|
{
|
||||||
_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[]
|
public IEnumerable<Theme> Themes { get; } = Enum.GetValues(typeof(Theme)).Cast<Theme>();
|
||||||
{
|
|
||||||
Theme.Default,
|
|
||||||
Theme.Light,
|
|
||||||
Theme.Dark
|
|
||||||
};
|
|
||||||
|
|
||||||
public Theme Theme
|
public Theme Theme
|
||||||
{
|
{
|
||||||
@ -67,15 +65,7 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IReadOnlyCollection<BootstrapperStyle> Dialogs { get; set; } = new BootstrapperStyle[]
|
public IEnumerable<BootstrapperStyle> Dialogs { get; } = Enum.GetValues(typeof(BootstrapperStyle)).Cast<BootstrapperStyle>();
|
||||||
{
|
|
||||||
BootstrapperStyle.FluentDialog,
|
|
||||||
BootstrapperStyle.ProgressDialog,
|
|
||||||
BootstrapperStyle.LegacyDialog2011,
|
|
||||||
BootstrapperStyle.LegacyDialog2008,
|
|
||||||
BootstrapperStyle.VistaDialog,
|
|
||||||
BootstrapperStyle.ByfronDialog
|
|
||||||
};
|
|
||||||
|
|
||||||
public BootstrapperStyle Dialog
|
public BootstrapperStyle Dialog
|
||||||
{
|
{
|
||||||
@ -83,31 +73,14 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
|||||||
set => App.Settings.Prop.BootstrapperStyle = value;
|
set => App.Settings.Prop.BootstrapperStyle = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IReadOnlyCollection<BootstrapperIcon> Icons { get; set; } = new BootstrapperIcon[]
|
public ObservableCollection<BootstrapperIconEntry> Icons { get; set; } = new();
|
||||||
{
|
|
||||||
BootstrapperIcon.IconBloxstrap,
|
|
||||||
BootstrapperIcon.Icon2022,
|
|
||||||
BootstrapperIcon.Icon2019,
|
|
||||||
BootstrapperIcon.Icon2017,
|
|
||||||
BootstrapperIcon.IconLate2015,
|
|
||||||
BootstrapperIcon.IconEarly2015,
|
|
||||||
BootstrapperIcon.Icon2011,
|
|
||||||
BootstrapperIcon.Icon2008,
|
|
||||||
BootstrapperIcon.IconCustom
|
|
||||||
};
|
|
||||||
|
|
||||||
public BootstrapperIcon Icon
|
public BootstrapperIcon Icon
|
||||||
{
|
{
|
||||||
get => App.Settings.Prop.BootstrapperIcon;
|
get => App.Settings.Prop.BootstrapperIcon;
|
||||||
set
|
set => App.Settings.Prop.BootstrapperIcon = value;
|
||||||
{
|
|
||||||
App.Settings.Prop.BootstrapperIcon = value;
|
|
||||||
OnPropertyChanged(nameof(IconPreviewSource));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageSource IconPreviewSource => App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource();
|
|
||||||
|
|
||||||
public string Title
|
public string Title
|
||||||
{
|
{
|
||||||
get => App.Settings.Prop.BootstrapperTitle;
|
get => App.Settings.Prop.BootstrapperTitle;
|
||||||
@ -119,11 +92,20 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
|||||||
get => App.Settings.Prop.BootstrapperIconCustomLocation;
|
get => App.Settings.Prop.BootstrapperIconCustomLocation;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
App.Settings.Prop.BootstrapperIcon = BootstrapperIcon.IconCustom;
|
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;
|
App.Settings.Prop.BootstrapperIconCustomLocation = value;
|
||||||
|
|
||||||
OnPropertyChanged(nameof(Icon));
|
OnPropertyChanged(nameof(Icon));
|
||||||
OnPropertyChanged(nameof(IconPreviewSource));
|
OnPropertyChanged(nameof(Icons));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user