From 3e79e2b5f819ea3d845c083d49f8c4ce75014bcf Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Mon, 13 Dec 2021 16:39:39 -0800 Subject: [PATCH] Fix setups path chooser in preferences window - This was broken by #9 --- src/gui.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui.rs b/src/gui.rs index 0868e56..f94347e 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -10,6 +10,7 @@ use copypasta::{ClipboardContext, ClipboardProvider}; use egui::widgets::color_picker::{color_edit_button_srgba, Alpha}; use egui::{CtxRef, Widget}; use hotwatch::Hotwatch; +use std::borrow::Cow; use std::collections::{HashMap, VecDeque}; use std::path::Path; use std::time::{Duration, Instant}; @@ -591,8 +592,10 @@ impl Gui { // Setup exports path selection ui.horizontal(|ui| { - let setups_path = self.config.get_setups_path(); - let label = setups_path.to_string_lossy().ellipsis(50); + // XXX: Workaround for https://github.com/PolyMeilex/rfd/issues/32 + let setups_path = self.config.get_setups_path().to_string_lossy(); + let setups_path = setups_path.strip_prefix(r"\\?\").unwrap_or(&setups_path); + let label = Cow::Borrowed(setups_path).ellipsis(50); ui.label("Setup exports path:"); if egui::Label::new(label)