summaryrefslogtreecommitdiff
path: root/iced_builder/src/types
diff options
context:
space:
mode:
Diffstat (limited to 'iced_builder/src/types')
-rw-r--r--iced_builder/src/types/project.rs5
-rwxr-xr-xiced_builder/src/types/rendered_element.rs8
2 files changed, 6 insertions, 7 deletions
diff --git a/iced_builder/src/types/project.rs b/iced_builder/src/types/project.rs
index 0e0442a..95de9e6 100644
--- a/iced_builder/src/types/project.rs
+++ b/iced_builder/src/types/project.rs
@@ -103,7 +103,7 @@ impl Project {
{app_code}
fn main() -> iced::Result {{
- iced::run("{}", State::update, State::view)
+ iced::application("{}", State::update, State::view).theme(iced::Theme::{}).run()
}}
#[derive(Default)]
@@ -122,7 +122,8 @@ impl Project {
match &self.title {
Some(t) => t,
None => "New app",
- }
+ },
+ self.get_theme().to_string().replace(" ", "")
);
let config = Config::new_str()
.edition(Edition::Rust2021)
diff --git a/iced_builder/src/types/rendered_element.rs b/iced_builder/src/types/rendered_element.rs
index e2bebfa..3be0d2e 100755
--- a/iced_builder/src/types/rendered_element.rs
+++ b/iced_builder/src/types/rendered_element.rs
@@ -109,10 +109,7 @@ impl RenderedElement {
pub fn insert_after(&mut self, id: Id, element: &RenderedElement) {
if let Some(child_elements) = self.child_elements.as_mut() {
- if let Some(index) = child_elements
- .iter()
- .position(|x| Id::new(x.id.clone()) == id)
- {
+ if let Some(index) = child_elements.iter().position(|x| x.get_id() == id) {
child_elements.insert(index + 1, element.clone());
} else {
child_elements.push(element.clone());
@@ -178,7 +175,8 @@ impl RenderedElement {
iced_drop::droppable(
widget::container(
widget::column![widget::text(self.name.clone().to_string()), children]
- .width(Length::Fill),
+ .width(Length::Fill)
+ .spacing(10),
)
.padding(10)
.style(widget::container::bordered_box),