Skip to main content

corundum_framework_gui/
lib.rs

1//! The look shared by the sapphire apps and asteria: what an egui app's window is made of
2//! before any of its own screens.
3//!
4//! [`Shell`] is the window frame: the app's screens on a rail (a bottom bar when narrow, as
5//! on a phone), with a footer for Settings and a slot of the app's own. [`fonts`] finds a
6//! CJK fallback font on the system; [`icons`] is a set of Lucide icons and the SVG loader
7//! that draws them; [`theme`] is the colours — light and dark, the contrast, the accent;
8//! [`i18n`] is the translations — every string looked up by id in the user's language,
9//! through [`tr!`]. [`settings`] is the Settings screen: the pages an app and the
10//! frameworks under it put in, the tabs of the scopes a setting can be kept in, and the
11//! theme and the language over them. [`detail`] is the app's side pane: a right column
12//! beside every screen, a card over it, or on a phone the screen in its place; its column's
13//! toggle sits at the right end of the shell's status bar. [`explorer`] is a folder's
14//! contents the app hands in, to browse, pick, move and rename. With the `serde` feature,
15//! [`store`] is corundum's file on the device, `corundum.toml`: what the person left the UI
16//! in — [`look`], the theme and the language in effect, and the order of the shell's rail —
17//! put back before the app's first frame. With the `qr-code` feature, [`qr`] draws text as
18//! a QR code, for a phone to read off the screen.
19//!
20//! The components depend on egui alone, so they render inside any host's egui context, on
21//! the desktops and on phones. With the `eframe` feature (on by default), [`window::run`]
22//! opens a desktop window on wgpu the same way for every app, set up by [`gpu`]; an app that
23//! renders egui without eframe turns default features off.
24//!
25//! With the `media-session` feature, `media_session` puts a music player under the OS's
26//! media keys and in its "now playing", and `media_session::start` makes one for an eframe
27//! window. With the `single-instance` feature, `WindowOptions::single_instance` keeps a
28//! desktop app to one window: a second start brings the first's to the front and exits.
29
30/// The egui this crate renders with. Apps should use this re-export so their egui is
31/// always the one the components were built against.
32pub use egui;
33
34/// The eframe [`window::run`] opens windows with, for the same reason as [`egui`].
35#[cfg(feature = "eframe")]
36pub use eframe;
37
38pub mod detail;
39pub mod explorer;
40#[cfg(feature = "serde")]
41pub mod first_run;
42pub mod fonts;
43#[cfg(feature = "eframe")]
44pub mod gpu;
45pub mod i18n;
46pub mod icons;
47#[cfg(feature = "keys")]
48pub mod keys;
49pub mod logcat;
50#[cfg(feature = "serde")]
51pub mod look;
52#[cfg(feature = "media-session")]
53pub mod media_session;
54pub mod platform;
55#[cfg(feature = "qr-code")]
56pub mod qr;
57#[cfg(all(
58    feature = "service",
59    not(any(target_os = "ios", target_os = "android"))
60))]
61mod service;
62pub mod settings;
63mod shell;
64#[cfg(feature = "serde")]
65pub mod store;
66pub mod theme;
67#[cfg(feature = "update")]
68pub mod update;
69#[cfg(feature = "eframe")]
70pub mod window;
71
72#[cfg(test)]
73mod test_support;
74
75pub use shell::{Action, COMPACT_WIDTH, Destination, RailItem, RailOrder, Shell, ShellApp, Side};