Skip to main content

hyprcorrect_ui/
lib.rs

1//! The hyprcorrect GUI: the egui preferences window and (later, M4)
2//! the keyboard-navigable suggestion popup.
3//!
4//! All UI in this crate is platform-independent egui — Linux and
5//! macOS share the same code. The `run_preferences` entry handles a
6//! best-effort singleton lock so double-clicking "Open Preferences…"
7//! in the tray doesn't open two windows.
8//!
9//! See the "Configuration & GUI" section of `DESIGN.md`.
10
11mod apps;
12#[cfg(target_os = "linux")]
13pub mod autostart;
14mod docker;
15pub mod icon;
16mod ngrams;
17mod prefs;
18mod review;
19mod vimedit;
20mod worddiff;
21
22/// Open the preferences window. Blocks until the user closes it.
23///
24/// If another prefs window is already open, this returns immediately
25/// after best-effort asking the existing one to focus itself.
26pub fn run_preferences() {
27    prefs::run();
28}
29
30/// Open the review popup for the daemon's pending review request.
31/// Reads the request from the runtime file, shows the popup, and
32/// signals the daemon on exit so the apply happens against the
33/// originating window. Blocks until the user closes the popup.
34pub fn run_review() {
35    review::run();
36}