2022-12-31 03:14:28 +00:00
|
|
|
use dioxus::prelude::*;
|
2023-10-23 20:26:10 +00:00
|
|
|
use dioxus_desktop::{tao::dpi::PhysicalPosition, LogicalSize, WindowBuilder};
|
2022-12-31 03:14:28 +00:00
|
|
|
|
|
|
|
fn main() {
|
2024-01-19 22:19:49 +00:00
|
|
|
LaunchBuilder::desktop().with_cfg(make_config());
|
2022-12-31 03:14:28 +00:00
|
|
|
}
|
|
|
|
|
2024-01-14 04:51:37 +00:00
|
|
|
fn app() -> Element {
|
2024-01-16 19:18:46 +00:00
|
|
|
rsx! {
|
2022-12-31 03:14:28 +00:00
|
|
|
div {
|
2022-12-31 03:30:04 +00:00
|
|
|
width: "100%",
|
|
|
|
height: "100%",
|
|
|
|
background_color: "red",
|
|
|
|
border: "1px solid black",
|
|
|
|
|
|
|
|
div {
|
|
|
|
width: "100%",
|
|
|
|
height: "10px",
|
|
|
|
background_color: "black",
|
2023-10-23 20:26:10 +00:00
|
|
|
onmousedown: move |_| dioxus_desktop::window().drag(),
|
2022-12-31 03:14:28 +00:00
|
|
|
}
|
2022-12-31 03:30:04 +00:00
|
|
|
|
|
|
|
"This is an overlay!"
|
2022-12-31 03:14:28 +00:00
|
|
|
}
|
2024-01-14 05:12:21 +00:00
|
|
|
}
|
2022-12-31 03:14:28 +00:00
|
|
|
}
|
|
|
|
|
2022-12-31 03:30:04 +00:00
|
|
|
fn make_config() -> dioxus_desktop::Config {
|
|
|
|
dioxus_desktop::Config::default()
|
|
|
|
.with_window(make_window())
|
|
|
|
.with_custom_head(
|
|
|
|
r#"
|
|
|
|
<style type="text/css">
|
|
|
|
html, body {
|
|
|
|
height: 100px;
|
|
|
|
margin: 0;
|
|
|
|
overscroll-behavior-y: none;
|
|
|
|
overscroll-behavior-x: none;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
#main, #bodywrap {
|
|
|
|
height: 100%;
|
|
|
|
margin: 0;
|
|
|
|
overscroll-behavior-x: none;
|
|
|
|
overscroll-behavior-y: none;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
"#
|
|
|
|
.to_owned(),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn make_window() -> WindowBuilder {
|
|
|
|
WindowBuilder::new()
|
|
|
|
.with_transparent(true)
|
|
|
|
.with_decorations(false)
|
|
|
|
.with_resizable(false)
|
|
|
|
.with_always_on_top(true)
|
|
|
|
.with_position(PhysicalPosition::new(0, 0))
|
|
|
|
.with_max_inner_size(LogicalSize::new(100000, 50))
|
2022-12-31 03:14:28 +00:00
|
|
|
}
|