mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 06:21:23 +00:00
now can select multiple dirs at once
This commit is contained in:
+4
-4
@@ -223,10 +223,10 @@ impl SoundpadGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
let add_dir_button = Button::new(icons::ICON_ADD).frame(false);
|
let add_dirs_button = Button::new(icons::ICON_ADD).frame(false);
|
||||||
let add_dir_button_response = ui.add_sized([18.0, 18.0], add_dir_button);
|
let add_dirs_button_response = ui.add_sized([18.0, 18.0], add_dirs_button);
|
||||||
if add_dir_button_response.clicked() {
|
if add_dirs_button_response.clicked() {
|
||||||
self.add_dir();
|
self.add_dirs();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -79,10 +79,12 @@ impl SoundpadGui {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_dir(&mut self) {
|
pub fn add_dirs(&mut self) {
|
||||||
let file_dialog = FileDialog::new();
|
let file_dialog = FileDialog::new();
|
||||||
if let Some(path) = file_dialog.pick_folder() {
|
if let Some(paths) = file_dialog.pick_folders() {
|
||||||
|
for path in paths {
|
||||||
self.app_state.dirs.insert(path);
|
self.app_state.dirs.insert(path);
|
||||||
|
}
|
||||||
self.config.dirs = self.app_state.dirs.clone();
|
self.config.dirs = self.app_state.dirs.clone();
|
||||||
self.config.save_to_file().ok();
|
self.config.save_to_file().ok();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user