summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-05-12 18:19:36 +0200
committerMatthias Beyer <mail@beyermatthias.de>2020-05-12 18:21:38 +0200
commit428fa2f35212e6cb2403427a71f31658dc0b9425 (patch)
tree8cb753e933d41d3dac3a1a48bf3407e8858c5692 /src/main.rs
parentdd194d99426b59344290355580aeebbd4da90e57 (diff)
Add css style
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 8de1e6a..4444e52 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -102,7 +102,7 @@ async fn main() -> Result<()> {
let html_content = include_str!("../assets/index.html");
- web_view::builder()
+ let mut view = web_view::builder()
.title("My Project")
.content(web_view::Content::Html(html_content))
.resizable(true)
@@ -110,8 +110,10 @@ async fn main() -> Result<()> {
.user_data(())
.invoke_handler(|_webview, _arg| Ok(()))
.build()
- .map_err(Error::from)?
- .run()
- .map_err(Error::from)
+ .map_err(Error::from)?;
+
+ view.inject_css(include_str!("../assets/style.css"))?;
+
+ view.run().map_err(Error::from)
}