-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add new apply style feature #284
base: dev
Are you sure you want to change the base?
Conversation
Format code Fix ProgressBar and Slider style issue
@@ -232,7 +232,7 @@ public static T SetEnvironment<T>(this T contextualObject, Type type, string key | |||
return contextualObject; | |||
} | |||
|
|||
public static T SetEnvironment<T,TValue>(this T view, Type type, string key, Binding<TValue> binding, bool cascades = true, ControlState state = ControlState.Default) | |||
public static T SetEnvironment<T, TValue>(this T view, Type type, string key, Binding<TValue> binding, bool cascades = true, ControlState state = ControlState.Default) |
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.
In the future lets try and avoid white noise changes.
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.
It will be better to have some tools to format code in current code base.
public const string TrackColor = "SliderTrackColor"; | ||
public const string ProgressColor = "SliderProgressColor"; | ||
public const string ThumbColor = "SliderThumbColor"; | ||
public const string TrackColor = "MinimumTrackColor"; |
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.
Why are the values changing?
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.
Cause the MAUI API changed, you know the Comet.SourceGenerator project, the Slider class output file is this.
Microsoft.Maui.Graphics.Color Microsoft.Maui.ISlider.MinimumTrackColor => this.GetEnvironment<Microsoft.Maui.Graphics.Color>("MinimumTrackColor") ?? default;
Microsoft.Maui.Graphics.Color Microsoft.Maui.ISlider.MaximumTrackColor => this.GetEnvironment<Microsoft.Maui.Graphics.Color>("MaximumTrackColor") ?? default;
Microsoft.Maui.Graphics.Color Microsoft.Maui.ISlider.ThumbColor => this.GetEnvironment<Microsoft.Maui.Graphics.Color>("ThumbColor") ?? default;
Microsoft.Maui.IImageSource Microsoft.Maui.ISlider.ThumbImageSource => this.GetEnvironment<Microsoft.Maui.IImageSource>("ThumbImageSource") ?? default;
@@ -60,6 +60,11 @@ public static class View | |||
public const string Opacity = nameof(Microsoft.Maui.IView.Opacity); | |||
} | |||
|
|||
public static class Button | |||
{ | |||
public const string Padding = "Padding"; |
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.
Why is this being added to Button? The Padding stuff already exists on layout, and should work for any view.
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.
That is MAUI button Padding property, I think it should be different from the padding of layout?
@@ -86,7 +86,6 @@ public MaterialStyle(ColorPalette colorPalette) | |||
ProgressBar = new ProgressBarStyle | |||
{ | |||
ProgressColor = colorPalette.P500, | |||
TrackColor = colorPalette.P100, |
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.
Why is this being deleted?
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.
MAUI API changed, there's no TrackColor property in Progress class
@@ -5,7 +5,6 @@ namespace Comet.Styles | |||
{ | |||
public class ProgressBarStyle : ViewStyle | |||
{ | |||
public StyleAwareValue<ControlState, Color> TrackColor { get; set; } |
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.
Why is this being deleted?
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.
MAUI API changed, there's no TrackColor property in Progress class
@@ -175,7 +175,6 @@ protected virtual void ApplySliderStyle(ContextualObject view) | |||
|
|||
protected virtual void ApplyProgresBarStyle(ContextualObject view) | |||
{ | |||
SetEnvironment(view, "", EnvironmentKeys.ProgressBar.TrackColor, ProgressBar?.TrackColor); |
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.
Why is this being deleted?
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.
same with above
Format code
Fix ProgressBar and Slider style issue
Add new way to apply style