diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-05-12 18:04:48 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-05-12 18:07:04 +0200 |
commit | dd194d99426b59344290355580aeebbd4da90e57 (patch) | |
tree | 182a648a97a65bcc32b35c851f5c48ae8e166a2d /src | |
parent | f475a18746c337440d59592af484e857237f9064 (diff) |
Add basic code for web-view GUI implementation
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 6ec2e89..8de1e6a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,8 @@ extern crate hyper; extern crate env_logger; extern crate itertools; extern crate xdg; +extern crate handlebars; +extern crate web_view; #[macro_use] extern crate failure; #[macro_use] extern crate is_match; @@ -43,6 +45,7 @@ use futures::future::TryFutureExt; use serde_json::to_string_pretty as serde_json_to_string_pretty; use serde_json::from_str as serde_json_from_str; use failure::Fallible as Result; +use failure::Error; use failure::err_msg; use crate::app::App; @@ -97,8 +100,18 @@ async fn main() -> Result<()> { } }.await?; - drop(config); - - Ok(()) + let html_content = include_str!("../assets/index.html"); + + web_view::builder() + .title("My Project") + .content(web_view::Content::Html(html_content)) + .resizable(true) + .debug(true) + .user_data(()) + .invoke_handler(|_webview, _arg| Ok(())) + .build() + .map_err(Error::from)? + .run() + .map_err(Error::from) } |