-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Globals: Add DialogDefaults.DefaultFocus
, Consolidate others to their own static classes
#8831
Globals: Add DialogDefaults.DefaultFocus
, Consolidate others to their own static classes
#8831
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #8831 +/- ##
==========================================
+ Coverage 89.82% 90.04% +0.21%
==========================================
Files 412 421 +9
Lines 11878 12292 +414
Branches 2364 2437 +73
==========================================
+ Hits 10670 11068 +398
+ Misses 681 672 -9
- Partials 527 552 +25 ☔ View full report in Codecov by Sentry. |
In principle yes, it makes sense to have global defaults for every parameter, even those of |
When we add defaults for all components, there will be hundreds of definitions in i.e. |
@henon Do you want to implement your vision for that API separately and I rebase? Or tell me what the classes would look like and I can do it in this PR? |
public static class MudGlobal {
public static class DialogDefaults {
public DefaultFocus DefaultFocus = DefaultFocus.Element;
}
public static class ButtonDefaults {
public static Variant Variant = Variant.Text;
}
} |
MudGlobal.DialogDefaultFocus
DialogDefaults.DefaultFocus
, Consolidate others to their own static classes
@henon Done. Take a look now. |
Here is another idea, add these on top of what you already have: public static class OverlayDefaults
{
/// <summary>
/// The default transition delay for <see cref="MudOverlay"/> and <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Delay { get; set; } = TransitionDefaults.Delay;
/// <summary>
/// The default transition time for components like <see cref="MudTooltip"/>, <see cref="MudOverlay"/>, <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Duration { get; set; } = TransitionDefaults.Duration;
}
public static class PickerDefaults
{
/// <summary>
/// The default transition delay for <see cref="MudOverlay"/> and <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Delay { get; set; } = TransitionDefaults.Delay;
/// <summary>
/// The default transition time for components like <see cref="MudTooltip"/>, <see cref="MudOverlay"/>, <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Duration { get; set; } = TransitionDefaults.Duration;
}
public static class TooltipDefaults
{
/// <summary>
/// The default transition delay for <see cref="MudOverlay"/> and <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Delay { get; set; } = TransitionDefaults.Delay;
/// <summary>
/// The default transition time for components like <see cref="MudTooltip"/>, <see cref="MudOverlay"/>, <see cref="MudPicker{T}"/>.
/// </summary>
public static TimeSpan Duration { get; set; } = TransitionDefaults.Duration;
} That way, on top of changing the delay and transition duration for all via TransitionDefaults we can also set them differently for overlay, picker and tooltip. |
@henon Good idea. Added. |
@@ -55,21 +55,21 @@ public partial class MudTooltip : MudComponentBase | |||
/// Sets the length of time that the opening transition takes to complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ScarletKuro What do you say, shall we replace all usages of double
and int
for timespans in the library with TimeSpan
while we are at it, in v7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am talking about this in MudTooltip for instance:
/// Sets the length of time that the opening transition takes to complete.
/// </summary>
/// <remarks>
/// Set globally via <see cref="MudGlobal.TransitionDefaults.Duration"/>.
/// </remarks>
[Parameter]
[Category(CategoryTypes.Tooltip.Appearance)]
public double Duration { get; set; } = MudGlobal.TransitionDefaults.Duration.TotalMilliseconds;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context: #8574
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ScarletKuro can be merged from my point of view
Description
How Has This Been Tested?
Type of Changes
Checklist
dev
).