diff --git a/rust/src/shards/gui/containers/panels.rs b/rust/src/shards/gui/containers/panels.rs index 7ae9f9a8fb..c77b99bbb4 100644 --- a/rust/src/shards/gui/containers/panels.rs +++ b/rust/src/shards/gui/containers/panels.rs @@ -109,6 +109,10 @@ macro_rules! impl_panel { Some(&self.requiring) } + fn hasCompose() -> bool { + true + } + fn compose(&mut self, data: &InstanceData) -> Result { // we need to inject UI variable to the inner shards let mut data = *data; @@ -292,6 +296,10 @@ impl Shard for CentralPanel { Some(&self.requiring) } + fn hasCompose() -> bool { + true + } + fn compose(&mut self, data: &InstanceData) -> Result { // we need to inject UI variable to the inner shards let mut data = *data; diff --git a/rust/src/shards/gui/containers/window.rs b/rust/src/shards/gui/containers/window.rs index 927d567ea6..bc0d250423 100644 --- a/rust/src/shards/gui/containers/window.rs +++ b/rust/src/shards/gui/containers/window.rs @@ -119,6 +119,10 @@ impl Shard for Window { Some(&self.requiring) } + fn hasCompose() -> bool { + true + } + fn compose(&mut self, data: &InstanceData) -> Result { // we need to inject UI variable to the inner shards let mut data = *data; diff --git a/rust/src/shards/gui/context.rs b/rust/src/shards/gui/context.rs index 4e83bae12e..bf563dccad 100644 --- a/rust/src/shards/gui/context.rs +++ b/rust/src/shards/gui/context.rs @@ -133,6 +133,10 @@ impl Shard for EguiContext { Some(&self.requiring) } + fn hasCompose() -> bool { + true + } + fn compose(&mut self, data: &InstanceData) -> Result { // we need to inject the UI context to the inner shards let mut data = *data; diff --git a/rust/src/shards/gui/mod.rs b/rust/src/shards/gui/mod.rs index 6855ff0161..dc2a999eae 100644 --- a/rust/src/shards/gui/mod.rs +++ b/rust/src/shards/gui/mod.rs @@ -14,6 +14,7 @@ use egui::Context as EguiNativeContext; use std::ffi::c_void; static BOOL_OR_NONE_SLICE: &[Type] = &[common_type::bool, common_type::none]; +static STRING_VAR_SLICE: &[Type] = &[common_type::string, common_type::string_var]; static EGUI_UI_TYPE: Type = Type::object(FRAG_CC, 1701279061); // 'eguU' static EGUI_UI_SLICE: &'static [Type] = &[EGUI_UI_TYPE]; diff --git a/rust/src/shards/gui/widgets/button.rs b/rust/src/shards/gui/widgets/button.rs index f492217614..3cc5222f9b 100644 --- a/rust/src/shards/gui/widgets/button.rs +++ b/rust/src/shards/gui/widgets/button.rs @@ -125,6 +125,10 @@ impl Shard for Button { Some(&self.requiring) } + fn hasCompose() -> bool { + true + } + fn compose(&mut self, data: &InstanceData) -> Result { if !self.action.is_empty() { self.action.compose(&data)?; diff --git a/rust/src/shards/gui/widgets/mod.rs b/rust/src/shards/gui/widgets/mod.rs index f9b44d3298..6da902bffb 100644 --- a/rust/src/shards/gui/widgets/mod.rs +++ b/rust/src/shards/gui/widgets/mod.rs @@ -22,10 +22,22 @@ struct Label { wrap: ParamVar, } +struct TextInput { + parents: ParamVar, + requiring: ExposedTypes, + variable: ParamVar, + multiline: ParamVar, + exposing: ExposedTypes, + should_expose: bool, + mutable_text: bool, +} + mod button; mod label; +mod text_input; pub fn registerShards() { registerShard::