add copy button

This commit is contained in:
Matthew Ryan Dillon 2024-08-22 06:52:28 -04:00
parent 5e5d466edf
commit 7b96493b28

View file

@ -61,6 +61,11 @@ fn ui_system(mut contexts: EguiContexts, mut state: ResMut<State>) {
state.needs_update = true;
}
let copy_button = ui.button("Copy");
if copy_button.clicked() {
ui.output_mut(|o| o.copied_text = state.output_value.clone());
}
let clear_button = ui.button("Clear");
if clear_button.clicked() {
state.input_value = "".to_string();