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 the app’s side pane: a right column beside every screen, 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. explorer is a folder’s contents the app hands in, to browse, pick, move and rename. With the serde feature, [store] is corundum’s file on the device, corundum.toml: what the person left the UI in — [look], the theme and the language in effect, and the order of the shell’s rail — put back before the app’s first frame. With the qr-code feature, [qr] draws text as a QR code, for a phone to read off the screen.

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.

With the media-session feature, media_session puts a music player under the OS’s media keys and in its “now playing”, and media_session::start makes one for an eframe window. With the single-instance feature, WindowOptions::single_instance keeps a desktop app to one window: a second start brings the first’s to the front and exits.

Re-exports§

pub use egui;
pub use eframe;

Modules§

detail
DetailPane: a right column beside the screens — what the main view’s item holds (the playlist playing, the journal open), or a new entry begun from the rail’s action — over the main view when there is no room for it, or in its place on a phone; and toggle_ui, the button turning its column on and off, which the Shell’s status bar holds.
explorer
FileExplorer: a folder’s contents as a list or a grid of tiles, under a trail of the folders above it — to go into a folder, open a file, pick some, and drag them into another folder or rename one.
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, the margins the system’s bars and keyboard take (Android), the system’s dialogs to pick a file or a folder, and its file manager.
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.
RailOrder
The order of the rail’s screens and actions, and which of them it leaves to the More menu: what the person set on the rail’s settings page, kept by the app or, with the serde feature, on the device by store.
Shell
The window frame. Hold one as the app’s root; call show every frame with the app, a ShellApp.
Side
The side pane, as a ShellApp asks things of it. What is asked is done after the call. Under the deprecated closures of Shell::ui, with no side pane, it asks nothing.

Enums§

RailItem
A screen or an action on the rail, for Shell::from_items: the two mix in any order, so the action used most — a new entry — can come first.

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.

Traits§

ShellApp
An app as the shell draws it, each frame, with Shell::show: its screens, its side pane, its foot and status, and what its actions do. The shell calls these in turn, each with the app’s &mut self, so a screen and the side pane share the app’s state freely.