Make it easy to clear/reset mappings
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user