feat: initial version

This commit is contained in:
2026-05-07 00:30:14 +05:00
parent 0ef72d3587
commit 6f45ebaadc
11 changed files with 6847 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
use std::rc::Rc;
slint::include_modules!();
fn init() -> State {
let browser_model = Rc::new(slint::VecModel::<BrowserConfig>::from(vec![
BrowserConfig {
path: "chrome.exe".into(),
flags: "profile 1".into(),
},
BrowserConfig {
path: "chrome.exe".into(),
flags: "profile 2".into(),
},
BrowserConfig {
path: "zen.exe".into(),
flags: "".into(),
},
BrowserConfig {
path: "edge.exe".into(),
flags: "".into(),
},
]));
let main_window = MainWindow::new().unwrap();
{
main_window.window().on_close_requested(move || {
todo!();
});
}
main_window.set_browser_model(browser_model.clone().into());
State {
main_window,
browser_model: browser_model,
}
}
pub struct State {
pub main_window: MainWindow,
pub browser_model: Rc<slint::VecModel<BrowserConfig>>,
}
pub fn main() {
let state = init();
let main_window = state.main_window.clone_strong();
#[cfg(target_os = "android")]
STATE.with(|ui| *ui.borrow_mut() = Some(state));
main_window.run().unwrap();
}