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/element_name.rs2
-rw-r--r--iced_builder/src/types/rendered_element.rs13
2 files changed, 12 insertions, 3 deletions
diff --git a/iced_builder/src/types/element_name.rs b/iced_builder/src/types/element_name.rs
index ca0668c..c30d6e3 100644
--- a/iced_builder/src/types/element_name.rs
+++ b/iced_builder/src/types/element_name.rs
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
use crate::Error;
use super::rendered_element::{
- self, button, column, container, image, row, svg, text, ActionKind, RenderedElement,
+ button, column, container, image, row, svg, text, ActionKind, RenderedElement,
};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
diff --git a/iced_builder/src/types/rendered_element.rs b/iced_builder/src/types/rendered_element.rs
index 827e8c2..6b01bc3 100644
--- a/iced_builder/src/types/rendered_element.rs
+++ b/iced_builder/src/types/rendered_element.rs
@@ -317,8 +317,17 @@ impl ActionKind {
};
let element = element_tree.as_mut().unwrap().find_by_id(id.clone());
- match element.unwrap().is_parent() {
- true => action = Self::PushFront(id),
+ match element.as_ref().unwrap().is_parent() {
+ true => {
+ let element = &element.unwrap();
+ if element.name == ElementName::Container
+ && element.child_elements != Some(vec![])
+ {
+ action = Self::Stop;
+ } else {
+ action = Self::PushFront(id);
+ }
+ }
false => {
if ids.len() > 2 {
action = Self::InsertAfter(