Initial commit: Veritas NFC Tool (Smartcard & NFC Reader GUI Utility)
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
use anyhow::Result;
|
||||
use tao::{
|
||||
event::{Event, WindowEvent},
|
||||
event_loop::{ControlFlow, EventLoop},
|
||||
window::WindowBuilder,
|
||||
};
|
||||
use wry::WebViewBuilder;
|
||||
|
||||
pub fn launch_gui(url: &str) -> Result<()> {
|
||||
let event_loop = EventLoop::new();
|
||||
let window = WindowBuilder::new()
|
||||
.with_title("ACR122U NFC Studio Pro")
|
||||
.with_inner_size(tao::dpi::LogicalSize::new(1280.0, 850.0))
|
||||
.with_min_inner_size(tao::dpi::LogicalSize::new(900.0, 600.0))
|
||||
.build(&event_loop)?;
|
||||
|
||||
let _webview = WebViewBuilder::new(&window)
|
||||
.with_url(url)
|
||||
.build()?;
|
||||
|
||||
event_loop.run(move |event, _, control_flow| {
|
||||
*control_flow = ControlFlow::Wait;
|
||||
|
||||
if let Event::WindowEvent {
|
||||
event: WindowEvent::CloseRequested,
|
||||
..
|
||||
} = event
|
||||
{
|
||||
*control_flow = ControlFlow::Exit;
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user