Add dialog example
This commit is contained in:
parent
87ad2f7dd9
commit
d271159c07
5 changed files with 562 additions and 22 deletions
19
src/lib.rs
19
src/lib.rs
|
|
@ -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>> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue