Skip to main content

Crate corundum_framework_gui

Crate corundum_framework_gui 

Source
Expand description

The look shared by the sapphire apps and asteria: what an egui app’s window is made of before any of its own screens.

Shell is the window frame: the app’s screens on a rail (a bottom bar when narrow, as on a phone), with a footer for Settings and a slot of the app’s own. fonts finds a CJK fallback font on the system; icons is a set of Lucide icons and the SVG loader that draws them; theme is the colours — light and dark, the contrast, the accent; i18n is the translations — every string looked up by id in the user’s language, through tr!. settings is the Settings screen: the pages an app and the frameworks under it put in, the tabs of the scopes a setting can be kept in, and the theme and the language over them. detail is a main view’s detail pane: a right column beside it, a card over it, or on a phone the screen in its place; its column’s toggle sits at the right end of the shell’s status bar.

The components depend on egui alone, so they render inside any host’s egui context, on the desktops and on phones. With the eframe feature (on by default), window::run opens a desktop window on wgpu the same way for every app, set up by gpu; an app that renders egui without eframe turns default features off.

Re-exports§

pub use egui;
pub use eframe;

Modules§

detail
DetailPane: what the main view’s item holds — the playlist playing, the journal open — beside it, over it, or in its place — and toggle_ui, the button turning its column on and off, which the Shell’s status bar holds.
fonts
A CJK fallback font from the operating system, so apps ship no font assets.
gpu
Renderer setup: backend selection and device-loss reporting.
i18n
The translations: every string the user reads, looked up by id in the language the user chose.
icons
The Lucide icons (ISC license, assets/icons/LICENSE-Lucide) shared by the apps.
logcat
tracing to logcat: on Android a process’s stderr goes nowhere.
platform
What a window needs from the platform and egui cannot give it: the clipboard where egui has none, and the margins the system’s bars and keyboard take (Android).
settings
The settings screen, and the pieces its pages are made of.
theme
The colours: light and dark, three contrast levels, an accent of the user’s.
window
A desktop window: eframe on wgpu, with the renderer set up by gpu and a CJK font behind egui’s own.

Macros§

tr
Look a message up: tr or, with arguments, tr_args.

Structs§

Action
A button of the app’s on the rail that does something — “new-entry” — rather than open a screen. Shell::take_action says which one was clicked.
Destination
One of the app’s screens on the rail.
Shell
The window frame. Hold one as the app’s root; call ui every frame.

Constants§

COMPACT_WIDTH
Below this width the layout is a phone’s: the rail becomes a bottom bar, and screens with a list and a page show one at a time.