Selenium39 / rust-shot

截图+OCR+ChatGPT
0 stars 0 forks source link

UI #3

Closed Selenium39 closed 1 year ago

Selenium39 commented 1 year ago
use druid::{AppLauncher, Data, Lens, Widget, WidgetExt, WindowDesc};
use druid::widget::Button;

#[derive(Clone, Data, Lens)]
struct AppState {
}

fn ui_builder() -> impl Widget<AppState> {
    Button::new("开始截图")
        .on_click(|_ctx, _data: &mut AppState, _env| {
            start_screenshot();
        })
        .center()
}

fn main() {
    let main_window = WindowDesc::new(ui_builder()).title("RustShot");
    let state = AppState {};

    AppLauncher::with_window(main_window)
        .launch(state)
        .expect("Failed to launch application");
}

fn start_screenshot() {

}
Selenium39 commented 1 year ago

druid = "0.8.3"