Add proper inheritance for TextColor.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[Button]
|
[Button]
|
||||||
BackgroundColor = "#0f62fe"
|
BackgroundColor = "#0f62fe"
|
||||||
TextColor = "#37eb34"
|
TextColor = "#ffffff"
|
||||||
Padding = 16.0
|
Padding = 16.0
|
||||||
|
|
||||||
# Creates an empty rule for Button.Normal.
|
# Creates an empty rule for Button.Normal.
|
||||||
@@ -29,7 +29,6 @@ BackgroundColor = "#750e13"
|
|||||||
BackgroundColor = [0, 0, 0, 0]
|
BackgroundColor = [0, 0, 0, 0]
|
||||||
BorderSize = 1.0
|
BorderSize = 1.0
|
||||||
BorderColor = "#0f62fe"
|
BorderColor = "#0f62fe"
|
||||||
TextColor = "#0353e9"
|
|
||||||
|
|
||||||
[Button.Outline.Normal]
|
[Button.Outline.Normal]
|
||||||
TextColor = "#0353e9"
|
TextColor = "#0353e9"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class Style
|
|||||||
public Size BorderSize { get; set; }
|
public Size BorderSize { get; set; }
|
||||||
public Color? BorderColor { get; set; }
|
public Color? BorderColor { get; set; }
|
||||||
public float CornerRadius { get; set; }
|
public float CornerRadius { get; set; }
|
||||||
public Color TextColor { get; set; } = Color.White;
|
public Color? TextColor { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class StyleSheetLoader : ResourceLoader<StyleSheet>
|
public class StyleSheetLoader : ResourceLoader<StyleSheet>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class Button : Widget
|
|||||||
}
|
}
|
||||||
|
|
||||||
_padding = style.Padding;
|
_padding = style.Padding;
|
||||||
var textColor = style.TextColor;
|
var textColor = style.TextColor ?? Color.Black;
|
||||||
|
|
||||||
// renderer.SetTransform(GlobalPosition, Vector2.Zero);
|
// renderer.SetTransform(GlobalPosition, Vector2.Zero);
|
||||||
// renderer.DrawRectangle(new Vector2(Size.Width, Size.Height), backgroundColor);
|
// renderer.DrawRectangle(new Vector2(Size.Width, Size.Height), backgroundColor);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class Label : Widget
|
|||||||
RenderStyleBox(renderer, style);
|
RenderStyleBox(renderer, style);
|
||||||
|
|
||||||
renderer.SetTransform(GlobalPosition, Vector2.Zero);
|
renderer.SetTransform(GlobalPosition, Vector2.Zero);
|
||||||
renderer.DrawText(_suitableFont, _text, style.TextColor);
|
renderer.DrawText(_suitableFont, _text, style.TextColor ?? Color.Black);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnUpdate()
|
protected override void OnUpdate()
|
||||||
|
|||||||
Reference in New Issue
Block a user