From bf594550978af35cccd4115cd935ac7047be686e Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 29 Apr 2020 21:58:41 +0200 Subject: [PATCH] Add a bunch of TODOs --- emigui/src/containers/floating.rs | 2 +- emigui/src/containers/resize.rs | 1 + emigui/src/font.rs | 1 + emigui/src/fonts.rs | 8 +++++--- emigui/src/types.rs | 2 ++ emigui/src/widgets.rs | 2 ++ 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/emigui/src/containers/floating.rs b/emigui/src/containers/floating.rs index 16575212..d3ccadb9 100644 --- a/emigui/src/containers/floating.rs +++ b/emigui/src/containers/floating.rs @@ -16,7 +16,7 @@ pub struct State { pub size: Vec2, } -// TODO: rename Floating to something else. +// TODO: rename Floating to something else. Area? #[derive(Clone, Copy, Debug)] pub struct Floating { id: Id, diff --git a/emigui/src/containers/resize.rs b/emigui/src/containers/resize.rs index bbcc79d7..c4b10f68 100644 --- a/emigui/src/containers/resize.rs +++ b/emigui/src/containers/resize.rs @@ -6,6 +6,7 @@ pub struct State { pub size: Vec2, } +// TODO: auto-shink/grow should be part of another container! #[derive(Clone, Copy, Debug)] pub struct Resize { /// If false, we are no enabled diff --git a/emigui/src/font.rs b/emigui/src/font.rs index daec160d..d393e264 100644 --- a/emigui/src/font.rs +++ b/emigui/src/font.rs @@ -159,6 +159,7 @@ impl Font { } /// Height of one line of text. In points + /// TODO: rename height ? pub fn line_spacing(&self) -> f32 { self.scale_in_pixels / self.pixels_per_point } diff --git a/emigui/src/fonts.rs b/emigui/src/fonts.rs index 2f9fa116..02293b16 100644 --- a/emigui/src/fonts.rs +++ b/emigui/src/fonts.rs @@ -83,10 +83,12 @@ impl Fonts { // TODO: figure out a way to make the wasm smaller despite including a font. Zip it? let monospae_typeface_data = include_bytes!("../fonts/ProggyClean.ttf"); // Use 13 for this. NOTHING ELSE. - // let monospae_typeface_data = include_bytes!("../fonts/Roboto-Regular.ttf"); - // let variable_typeface_data = include_bytes!("../fonts/Comfortaa-Regular.ttf"); // Funny, hard to read - let variable_typeface_data = include_bytes!("../fonts/DejaVuSans.ttf"); // Basic, boring + // let monospae_typeface_data = include_bytes!("../fonts/Roboto-Regular.ttf"); + + let variable_typeface_data = include_bytes!("../fonts/Comfortaa-Regular.ttf"); // Funny, hard to read + + // let variable_typeface_data = include_bytes!("../fonts/DejaVuSans.ttf"); // Basic, boring, takes up more space self.definitions = definitions.clone(); self.fonts = definitions diff --git a/emigui/src/types.rs b/emigui/src/types.rs index 199ae5ed..0b7994d4 100644 --- a/emigui/src/types.rs +++ b/emigui/src/types.rs @@ -43,6 +43,8 @@ pub struct RawInput { /// What emigui maintains #[derive(Clone, Debug, Default)] pub struct GuiInput { + // TODO: mouse: Mouse as separate + // /// Is the button currently down? /// true the frame when it is pressed, /// false the frame it is released. diff --git a/emigui/src/widgets.rs b/emigui/src/widgets.rs index 75d39a65..7fc76c7f 100644 --- a/emigui/src/widgets.rs +++ b/emigui/src/widgets.rs @@ -14,6 +14,7 @@ pub use text_edit::*; /// Anything implementing Widget can be added to a Region with Region::add pub trait Widget { + // TODO: rename .ui( fn add_to(self, region: &mut Region) -> GuiResponse; } @@ -316,6 +317,7 @@ type SliderGetSet<'a> = Box) -> f32>; pub struct Slider<'a> { get_set_value: SliderGetSet<'a>, range: RangeInclusive, + // TODO: label: Option