From a9df49920e44ee443b922517128e57c38f769b07 Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Fri, 19 Jul 2024 15:13:30 +0300 Subject: [PATCH] fix csv example --- demos/cairo/src/main.rs | 7 +------ demos/cairo_shadow_button/src/main.rs | 9 +++++---- demos/calculator/src/main.rs | 2 +- demos/dialect/src/main.rs | 2 ++ demos/resters/src/main.rs | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/demos/cairo/src/main.rs b/demos/cairo/src/main.rs index 3eaca9d..4cf6f82 100644 --- a/demos/cairo/src/main.rs +++ b/demos/cairo/src/main.rs @@ -3,12 +3,7 @@ mod model; use { cairo::Context, flemish::{ - app, - frame::Frame, - color_themes, - enums::Color, - prelude::*, - OnEvent, Sandbox, Settings, + app, color_themes, enums::Color, frame::Frame, prelude::*, OnEvent, Sandbox, Settings, }, model::Model, }; diff --git a/demos/cairo_shadow_button/src/main.rs b/demos/cairo_shadow_button/src/main.rs index 9b7b33b..fa52bdf 100644 --- a/demos/cairo_shadow_button/src/main.rs +++ b/demos/cairo_shadow_button/src/main.rs @@ -7,9 +7,8 @@ use { flemish::{ app, button::Button, - color_themes, - draw, - enums::{Event, Align, Color, ColorDepth, Font, Shortcut}, + color_themes, draw, + enums::{Align, Color, ColorDepth, Event, Font, Shortcut}, frame::Frame, group::Flex, image::RgbImage, @@ -60,7 +59,9 @@ impl Sandbox for Model { crate::cairobutton() .with_label("@#<") .on_event(move |_| Message::Dec); - crate::frame().with_label(&self.value()).handle(crate::popup); + crate::frame() + .with_label(&self.value()) + .handle(crate::popup); crate::cairobutton() .with_label("@#>") .on_event(move |_| Message::Inc); diff --git a/demos/calculator/src/main.rs b/demos/calculator/src/main.rs index ddf4d58..283cdcb 100644 --- a/demos/calculator/src/main.rs +++ b/demos/calculator/src/main.rs @@ -143,7 +143,7 @@ impl Sandbox for Model { match message { Message::Quit => { let file = app::GlobalState::::get().with(move |file| file.clone()); - fs::write(file, rmp_serde::to_vec(&self).unwrap()).unwrap(); + std::fs::write(file, rmp_serde::to_vec(&self).unwrap()).unwrap(); app::quit(); } Message::Theme => self.theme = !self.theme, diff --git a/demos/dialect/src/main.rs b/demos/dialect/src/main.rs index 594daa5..2d8b1e5 100644 --- a/demos/dialect/src/main.rs +++ b/demos/dialect/src/main.rs @@ -212,6 +212,8 @@ fn info() { written using FLTK-RS

"#; + let (r, g, b) = Color::from_hex(0x2aa198).to_rgb(); + app::set_color(Color::Blue, r, g, b); let mut dialog = HelpDialog::default(); dialog.set_value(INFO); dialog.set_text_size(16); diff --git a/demos/resters/src/main.rs b/demos/resters/src/main.rs index 71d6573..972a908 100644 --- a/demos/resters/src/main.rs +++ b/demos/resters/src/main.rs @@ -11,7 +11,7 @@ use { frame::Frame, group::Flex, menu::Choice, - misc::{InputChoice,Progress}, + misc::{InputChoice, Progress}, prelude::*, text::{StyleTableEntry, TextBuffer, TextDisplay, WrapMode}, OnEvent, Sandbox, Settings,