From 99e141d9fe9c8f494bb15a9ca31c07d27722f9dd Mon Sep 17 00:00:00 2001 From: pml68 Date: Sat, 28 Sep 2024 23:10:17 +0200 Subject: feat: rework RenderedElement, prepare for JSON project format --- iced_builder/src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'iced_builder/src/main.rs') diff --git a/iced_builder/src/main.rs b/iced_builder/src/main.rs index 42ea627..971adce 100644 --- a/iced_builder/src/main.rs +++ b/iced_builder/src/main.rs @@ -132,7 +132,7 @@ impl Application for App { } Message::Drop(name, point, _) => { return iced_drop::zones_on_point( - move |zones| Message::HandleZones(name, zones), + move |zones| Message::HandleZones(name.clone(), zones), point, None, None, @@ -231,7 +231,11 @@ impl Application for App { .on_action(Message::EditorAction) .highlight::( highlighter::Settings { - theme: highlighter::Theme::Base16Mocha, + theme: if self.dark_theme { + highlighter::Theme::Base16Mocha + } else { + highlighter::Theme::InspiredGitHub + }, extension: "rs".to_string(), }, |highlight, _theme| highlight.to_format(), @@ -314,7 +318,7 @@ fn items_list_view(items: Vec) -> Element<'static, Message> let value = item.clone(); column = column.push( droppable(text(value.to_string())) - .on_drop(move |point, rect| Message::Drop(value, point, rect)), + .on_drop(move |point, rect| Message::Drop(value.clone(), point, rect)), ); } -- cgit v1.2.3