Add a bunch of TODOs

This commit is contained in:
Emil Ernerfeldt 2020-04-29 21:58:41 +02:00
parent 4c79064760
commit bf59455097
6 changed files with 12 additions and 4 deletions

View file

@ -16,7 +16,7 @@ pub struct State {
pub size: Vec2, pub size: Vec2,
} }
// TODO: rename Floating to something else. // TODO: rename Floating to something else. Area?
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]
pub struct Floating { pub struct Floating {
id: Id, id: Id,

View file

@ -6,6 +6,7 @@ pub struct State {
pub size: Vec2, pub size: Vec2,
} }
// TODO: auto-shink/grow should be part of another container!
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]
pub struct Resize { pub struct Resize {
/// If false, we are no enabled /// If false, we are no enabled

View file

@ -159,6 +159,7 @@ impl Font {
} }
/// Height of one line of text. In points /// Height of one line of text. In points
/// TODO: rename height ?
pub fn line_spacing(&self) -> f32 { pub fn line_spacing(&self) -> f32 {
self.scale_in_pixels / self.pixels_per_point self.scale_in_pixels / self.pixels_per_point
} }

View file

@ -83,10 +83,12 @@ impl Fonts {
// TODO: figure out a way to make the wasm smaller despite including a font. Zip it? // 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/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 monospae_typeface_data = include_bytes!("../fonts/Roboto-Regular.ttf");
let variable_typeface_data = include_bytes!("../fonts/DejaVuSans.ttf"); // Basic, boring
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.definitions = definitions.clone();
self.fonts = definitions self.fonts = definitions

View file

@ -43,6 +43,8 @@ pub struct RawInput {
/// What emigui maintains /// What emigui maintains
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
pub struct GuiInput { pub struct GuiInput {
// TODO: mouse: Mouse as separate
//
/// Is the button currently down? /// Is the button currently down?
/// true the frame when it is pressed, /// true the frame when it is pressed,
/// false the frame it is released. /// false the frame it is released.

View file

@ -14,6 +14,7 @@ pub use text_edit::*;
/// Anything implementing Widget can be added to a Region with Region::add /// Anything implementing Widget can be added to a Region with Region::add
pub trait Widget { pub trait Widget {
// TODO: rename .ui(
fn add_to(self, region: &mut Region) -> GuiResponse; fn add_to(self, region: &mut Region) -> GuiResponse;
} }
@ -316,6 +317,7 @@ type SliderGetSet<'a> = Box<dyn 'a + FnMut(Option<f32>) -> f32>;
pub struct Slider<'a> { pub struct Slider<'a> {
get_set_value: SliderGetSet<'a>, get_set_value: SliderGetSet<'a>,
range: RangeInclusive<f32>, range: RangeInclusive<f32>,
// TODO: label: Option<Label>
text: Option<String>, text: Option<String>,
precision: usize, precision: usize,
text_color: Option<Color>, text_color: Option<Color>,