From 6cc15eed68d1a87544a9bc7e88db7cd938c3a453 Mon Sep 17 00:00:00 2001 From: Warren Hood Date: Sat, 24 Aug 2024 04:28:48 +0200 Subject: [PATCH] Make the mods directory display in an uneditable text box for the edit profile view --- mmm/src/main.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mmm/src/main.rs b/mmm/src/main.rs index 3abea4c..edc1e96 100644 --- a/mmm/src/main.rs +++ b/mmm/src/main.rs @@ -318,6 +318,10 @@ impl ManagerGUI { previous_view: ManagerView, can_edit_name: bool, ) -> Element { + let current_mods_directory_display = match &self.profile_edit_settings.mods_dir { + Some(mods_dir) => mods_dir.display().to_string(), + None => String::from(""), + }; let mut profile_editor = column![ text("Profile Add/Edit").horizontal_alignment(iced::alignment::Horizontal::Center), row![ @@ -341,12 +345,9 @@ impl ManagerGUI { .spacing(5), row![ "Mods directory", - text( - if let Some(mods_dir) = &self.profile_edit_settings.mods_dir { - mods_dir.display().to_string() - } else { - "".into() - } + text_input( + "Browse for your MC instance's mods directory", + ¤t_mods_directory_display ), button("Browse").on_press(Message::BrowseModsDir) ]