Add dialog example

This commit is contained in:
Jeremy Soller 2024-02-01 15:55:52 -07:00
parent 87ad2f7dd9
commit d271159c07
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
5 changed files with 562 additions and 22 deletions

View file

@ -11,6 +11,7 @@ use app::{App, Flags};
mod app;
use config::{Config, CONFIG_VERSION};
mod config;
mod dialog;
mod key_bind;
mod localize;
mod menu;
@ -29,6 +30,24 @@ pub fn home_dir() -> PathBuf {
}
}
/// Runs application with these settings
pub fn dialog() -> Result<(), Box<dyn std::error::Error>> {
localize::localize();
let mut settings = Settings::default();
#[cfg(target_os = "redox")]
{
// Redox does not support resize if doing CSDs
settings = settings.client_decorations(false);
}
let flags = dialog::Flags {};
cosmic::app::run::<dialog::App>(settings, flags)?;
Ok(())
}
/// Runs application with these settings
#[rustfmt::skip]
pub fn main() -> Result<(), Box<dyn std::error::Error>> {