diff --git a/crates/composition/src/shell_composition.rs b/crates/composition/src/shell_composition.rs index 4088c98..7e6fa84 100644 --- a/crates/composition/src/shell_composition.rs +++ b/crates/composition/src/shell_composition.rs @@ -32,11 +32,7 @@ impl ShellComposition { self } - pub fn register_shell_window( - mut self, - component_name: impl Into, - config: WindowConfig, - ) -> Self { + pub fn with_window(mut self, component_name: impl Into, config: WindowConfig) -> Self { self.shell_windows.push(ShellWindowDefinition { component_name: component_name.into(), config, @@ -44,13 +40,13 @@ impl ShellComposition { self } - pub fn register_shell_windows(mut self, definitions: Vec) -> Self { + pub fn with_windows(mut self, definitions: Vec) -> Self { self.shell_windows.extend(definitions); self } - pub fn auto_discover(mut self, component_names: Vec>) -> Self { - self.auto_discover_components = component_names.into_iter().map(Into::into).collect(); + pub fn with_default_config_for(mut self, components: Vec>) -> Self { + self.auto_discover_components = components.into_iter().map(Into::into).collect(); self } @@ -68,7 +64,7 @@ impl ShellComposition { if self.shell_windows.is_empty() { return Err(Error::Domain(DomainError::Configuration { - message: "No shell windows registered. Use register_shell_window(), register_shell_windows(), or auto_discover()".to_string(), + message: "No shell windows registered. Use add_window(), add_windows(), or with_default_config_for()".to_string(), })); } diff --git a/src/lib.rs b/src/lib.rs index 977bad9..5f9450c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,7 +44,7 @@ //! // Create shell with typed WindowConfig //! let shell = ShellComposition::new() //! .with_compilation_result(compilation_result) -//! .register_shell_window("TopBar", WindowConfig::default()) +//! .with_window("TopBar", WindowConfig::default()) //! .build()?; //! //! shell.run()?;