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;
40pub mod fonts;
41#[cfg(feature = "eframe")]
42pub mod gpu;
43pub mod i18n;
44pub mod icons;
45pub mod logcat;
46#[cfg(feature = "serde")]
47pub mod look;
48#[cfg(feature = "media-session")]
49pub mod media_session;
50pub mod platform;
51#[cfg(feature = "qr-code")]
52pub mod qr;
53pub mod settings;
54mod shell;
55#[cfg(feature = "serde")]
56pub mod store;
57pub mod theme;
58#[cfg(feature = "update")]
59pub mod update;
60#[cfg(feature = "eframe")]
61pub mod window;
62
63#[cfg(test)]
64mod test_support;
65
66pub use shell::{Action, COMPACT_WIDTH, Destination, RailItem, RailOrder, Shell, ShellApp, Side};