itch reset settings on empty string (#227)

* Add option to reset all images

* Reset itch settings on empty string
This commit is contained in:
Philip Kristoffersen
2022-09-06 19:14:31 +02:00
committed by GitHub
parent b38281719f
commit 00848ae5e4
+11 -1
View File
@@ -197,7 +197,17 @@ self.settings.heroic.default_launch_through_heroic{
.unwrap_or(&mut empty_string);
ui.label("Itch.io Folder: ");
if ui.text_edit_singleline(itch_location).changed() {
self.settings.itch.location = Some(itch_location.to_string());
self.settings.itch.location = if itch_location.is_empty(){
None
}else {
Some(itch_location.to_string())
};
}else{
if !itch_location.is_empty(){
if ui.button("Reset").on_hover_text("Reset the itch path, let BoilR guess again").clicked(){
self.settings.itch.location = None;
}
}
}
});