Skip to content

Commit

Permalink
external_file: Add a button to copy all tag lines
Browse files Browse the repository at this point in the history
  • Loading branch information
cohaereo committed Jul 17, 2024
1 parent 3b681b6 commit f73e9ba
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/gui/external_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ impl ExternalFileScanView {
) -> Option<ViewAction> {
let mut result = None;

if ui.button("Copy tag list").clicked() {
let mut taglist = String::new();

for tag in &self.file_hashes {
if let Some(entry) = &tag.entry {
// let tagtype = TagType::from_type_subtype(entry.file_type, entry.file_subtype);
let fancy_tag = format_tag_entry(tag.hash.hash32(), Some(entry));
taglist += &format!("{fancy_tag} @ 0x{:X}\n", tag.offset);
}
}

ui.output_mut(|o| o.copied_text = taglist);
}

egui::ScrollArea::vertical().show_rows(ui, 22.0, self.file_hashes.len(), |ui, range| {
for tag in &self.file_hashes[range] {
if let Some(entry) = &tag.entry {
Expand Down

0 comments on commit f73e9ba

Please sign in to comment.