Compare commits
2 Commits
207c8a20a4
...
5d3a2c2222
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d3a2c2222 | |||
| e1e965796b |
2
TODO.md
2
TODO.md
@@ -98,7 +98,7 @@
|
|||||||
- Styling
|
- Styling
|
||||||
- ~~Style sheet~~
|
- ~~Style sheet~~
|
||||||
- ~~Add style settings for UI panels (for buttons, labels, etc.).~~
|
- ~~Add style settings for UI panels (for buttons, labels, etc.).~~
|
||||||
- Parse StyleSheet from TOML file.
|
- ~~Parse StyleSheet from TOML file.~~
|
||||||
- Animated styles
|
- Animated styles
|
||||||
- Find a way to reference external assets in the style (fonts, textures).
|
- Find a way to reference external assets in the style (fonts, textures).
|
||||||
- Create a default style for widgets.
|
- Create a default style for widgets.
|
||||||
|
|||||||
@@ -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