feat: you can now open dirs/files in system's file manager using context menus

This commit is contained in:
2026-02-14 15:09:05 +03:00
parent 654694cecf
commit baae7a1ccf
3 changed files with 490 additions and 4 deletions
+30 -4
View File
@@ -5,12 +5,10 @@ use egui::{
};
use egui_dnd::dnd;
use egui_material_icons::icons;
use pwsp::types::audio_player::TrackInfo;
use pwsp::types::{audio_player::TrackInfo, gui::AppState};
use pwsp::utils::gui::format_time_pair;
use std::{error::Error, time::Instant};
use pwsp::types::gui::AppState;
enum TrackAction {
Pause(u32),
Resume(u32),
@@ -343,12 +341,25 @@ impl SoundpadGui {
// Context menu
dir_button_response.context_menu(|ui| {
if ui
.button(format!("{} {}", icons::ICON_OPEN_IN_NEW, "Open"))
.button(format!("{} {}", icons::ICON_OPEN_IN_NEW, "Show"))
.clicked()
{
self.open_dir(&path);
}
if ui
.button(format!(
"{} {}",
icons::ICON_OPEN_IN_BROWSER,
"Open in File Manager"
))
.clicked()
{
if let Err(e) = opener::open(&path) {
eprintln!("Failed to open file manager: {}", e);
}
}
ui.separator();
if ui
@@ -465,6 +476,21 @@ impl SoundpadGui {
self.play_file(&entry_path, true);
self.app_state.selected_file = Some(entry_path.clone());
}
ui.separator();
if ui
.button(format!(
"{} {}",
icons::ICON_OPEN_IN_BROWSER,
"Show in File Manager"
))
.clicked()
{
if let Err(e) = opener::reveal(&entry_path) {
eprintln!("Failed to open file manager: {}", e);
}
}
});
}
});