Make it easy to clear/reset mappings

This commit is contained in:
2024-11-29 19:09:00 -05:00
parent ce7ba71ea0
commit 0c35a1e234
2 changed files with 58 additions and 19 deletions
+11
View File
@@ -50,6 +50,17 @@ impl InputWindow {
mappings: &RwLock<T>,
bind_message: &str,
) {
ui.horizontal(|ui| {
if ui.button("Use defaults").clicked() {
mappings.write().unwrap().use_default_mappings();
self.now_binding = None;
}
if ui.button("Clear all").clicked() {
mappings.write().unwrap().clear_all_mappings();
self.now_binding = None;
}
});
ui.separator();
let mut names = {
let mapping = mappings.read().unwrap();
mapping.mapping_names()