quadraui 0.1.0

Cross-platform Rust UI toolkit: write one AppLogic and run it unmodified on TUI, GTK4 (Linux), macOS, and Windows backends
Documentation
//! macOS shell runner: `run_with_shell()` wraps a [`ShellApp`] in an
//! AppShell and drives it through the standard macOS (AppKit) event loop.
//!
//! The shared [`crate::shell_adapter::ShellAdapter`] owns all runtime logic
//! (bottom-panel init, panel routing, resize recalc, click dispatch), and
//! [`crate::shell_adapter::build_shell_adapter`] owns assembling one from a
//! [`ShellConfig`] — shared across every backend since #497. This module
//! only wires the adapter into the macOS event loop, mirroring
//! `tui::shell_runner` / `gtk::shell_runner` (#465).
//!
//! `MacBackend` already implements every `Backend` trait method `AppShell`
//! renders through (`draw_activity_bar`, `draw_sidebar_panel`,
//! `draw_tab_bar`, `draw_panel`, `draw_status_bar`, …), so no new rasteriser
//! work is needed here — this is pure composition, same as the TUI/GTK
//! runners.
//!
//! Before quadraui#933, this always ran through [`super::run::run`], which
//! hardcodes the generic window title (`"quadraui (macos)"` —
//! [`ShellConfig::title`] was captured but never actually reached the
//! AppKit window). `config.title` now reaches the runner via
//! [`super::run::RunConfig`], mirroring `gtk::shell_runner::run_with_shell`
//! / `win::shell_runner::run_with_shell`.
//!
//! #947: [`ShellConfig::client_side_titlebar`] reaches the runner the same
//! way — copied onto [`RunConfig`] before this module's `config` is moved
//! into [`build_shell_adapter`], since `RunConfig` (not `ShellConfig`) is
//! what [`super::run::run_with`]'s window-creation call site actually
//! consults.

use super::run::RunConfig;
use crate::shell::{ShellApp, ShellConfig};
use crate::shell_adapter::build_shell_adapter;

/// Run a [`ShellApp`] with AppShell chrome on the macOS backend.
///
/// #1142: `config.app_icon` (set via [`ShellConfig::with_app_icon`])
/// reaches [`RunConfig::app_icon`] the same way `config.title` /
/// `config.client_side_titlebar` do — cloned out before `config` moves
/// into [`build_shell_adapter`], since `RunConfig` (not `ShellConfig`)
/// is what [`super::run::run_with`]'s AppKit-bootstrap call site
/// actually consults.
///
/// **Must be called from the main thread** — enforced transitively by
/// [`super::run::run_with`].
pub fn run_with_shell<A: ShellApp + 'static>(
    app: A,
    config: ShellConfig,
) -> std::process::ExitCode {
    let mut run_config =
        RunConfig::new(config.title.clone()).with_client_side_titlebar(config.client_side_titlebar);
    if let Some(app_icon) = config.app_icon.clone() {
        run_config = run_config.with_app_icon(app_icon);
    }
    let adapter = build_shell_adapter(app, config);
    super::run::run_with(adapter, run_config)
}