MessageBox now centered by default.

Dialog & MB now Thick linestyle by default.
This commit is contained in:
Tig
2024-08-04 12:01:35 -06:00
parent 981963a47b
commit ae46bba182
3 changed files with 15 additions and 8 deletions

View File

@@ -29,8 +29,9 @@
"Dialog.DefaultButtonAlignmentModes": "AddSpaceBetweenItems",
"FrameView.DefaultBorderStyle": "Single",
"Window.DefaultBorderStyle": "Single",
"Dialog.DefaultBorderStyle": "Single",
"MessageBox.DefaultBorderStyle": "Double",
"Dialog.DefaultBorderStyle": "Heavy",
"MessageBox.DefaultButtonAlignment": "Center",
"MessageBox.DefaultBorderStyle": "Heavy",
"Button.DefaultShadow": "None",
"ColorSchemes": [
{

View File

@@ -20,7 +20,7 @@ public class Dialog : Window
/// <remarks>This property can be set in a Theme.</remarks>
[SerializableConfigurationProperty (Scope = typeof (ThemeScope))]
[JsonConverter (typeof (JsonStringEnumConverter<Alignment>))]
public static Alignment DefaultButtonAlignment { get; set; } = Alignment.End;
public static Alignment DefaultButtonAlignment { get; set; } = Alignment.End; // Default is set in config.json
/// <summary>The default <see cref="Alignment"/> for <see cref="Dialog"/>.</summary>
/// <remarks>This property can be set in a Theme.</remarks>
@@ -48,7 +48,7 @@ public class Dialog : Window
/// </summary>
[SerializableConfigurationProperty (Scope = typeof (ThemeScope))]
[JsonConverter (typeof (JsonStringEnumConverter<ShadowStyle>))]
public new static ShadowStyle DefaultShadow { get; set; } = ShadowStyle.None;
public new static ShadowStyle DefaultShadow { get; set; } = ShadowStyle.None; // Default is set in config.json
/// <summary>
/// Defines the default border styling for <see cref="Dialog"/>. Can be configured via
@@ -57,7 +57,7 @@ public class Dialog : Window
[SerializableConfigurationProperty (Scope = typeof (ThemeScope))]
[JsonConverter (typeof (JsonStringEnumConverter<LineStyle>))]
public new static LineStyle DefaultBorderStyle { get; set; } = LineStyle.Single;
public new static LineStyle DefaultBorderStyle { get; set; } = LineStyle.Single; // Default is set in config.json
private readonly List<Button> _buttons = new ();

View File

@@ -33,7 +33,13 @@ public static class MessageBox
/// </summary>
[SerializableConfigurationProperty (Scope = typeof (ThemeScope))]
[JsonConverter (typeof (JsonStringEnumConverter<LineStyle>))]
public static LineStyle DefaultBorderStyle { get; set; } = LineStyle.Single;
public static LineStyle DefaultBorderStyle { get; set; } = LineStyle.Single; // Default is set in config.json
/// <summary>The default <see cref="Alignment"/> for <see cref="Dialog"/>.</summary>
/// <remarks>This property can be set in a Theme.</remarks>
[SerializableConfigurationProperty (Scope = typeof (ThemeScope))]
[JsonConverter (typeof (JsonStringEnumConverter<Alignment>))]
public static Alignment DefaultButtonAlignment { get; set; } = Alignment.Center; // Default is set in config.json
/// <summary>
/// Defines the default minimum MessageBox width, as a percentage of the screen width. Can be configured via
@@ -365,10 +371,10 @@ public static class MessageBox
var d = new Dialog
{
Title = title,
Buttons = buttonList.ToArray (),
ButtonAlignment = Alignment.Center,
ButtonAlignment = MessageBox.DefaultButtonAlignment,
ButtonAlignmentModes = AlignmentModes.StartToEnd | AlignmentModes.AddSpaceBetweenItems,
BorderStyle = MessageBox.DefaultBorderStyle,
Buttons = buttonList.ToArray (),
};
d.Width = Dim.Auto (DimAutoStyle.Auto,