Skip to content
Snippets Groups Projects
Unverified Commit 21444662 authored by Ygg01's avatar Ygg01
Browse files

Change default font name ``-> `DefaultFont`

parent 2f05a90e
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,8 @@ use kayak_core::{bind, Binding, InputEvent, MutableBound};
pub use render::font::FontMapping;
pub use render::image::ImageManager;
pub const DEFAULT_FONT : &'static str = "DefaultFont";
#[derive(Default)]
pub struct BevyKayakUIPlugin;
......
......@@ -64,7 +64,7 @@ impl FontMapping {
/// Set a default `KayakFont`
pub fn set_default(&mut self, handle: Handle<KayakFont>) {
self.add("", handle);
self.add(crate::DEFAULT_FONT, handle);
}
pub(crate) fn mark_all_as_new(&mut self) {
......
......@@ -7,8 +7,8 @@ use crate::core::{
widget, OnEvent, WidgetProps,
};
/// PRops used by the [`Text`] widget
#[derive(WidgetProps, Default, Debug, PartialEq, Clone)]
/// Props used by the [`Text`] widget
#[derive(WidgetProps, Debug, PartialEq, Clone)]
pub struct TextProps {
/// The string to display
pub content: String,
......@@ -28,6 +28,20 @@ pub struct TextProps {
pub focusable: Option<bool>,
}
impl Default for TextProps {
fn default() -> Self {
TextProps {
content: "".to_string(),
font: Some(bevy_kayak_ui::DEFAULT_FONT.into()),
line_height: None,
size: 0.0,
styles: None,
on_event: None,
focusable: None
}
}
}
#[widget]
/// A widget that renders plain text
///
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment