Skip to content

Commit

Permalink
show icon for all files
Browse files Browse the repository at this point in the history
  • Loading branch information
hacknus committed Dec 3, 2024
1 parent a64cdd1 commit 697b398
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/data/information_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ fn format_pixels(pixels: u32) -> String {
}

/// Wrapper for the `DirectoryEntry` struct, that also adds the option to store text content
#[derive(Debug)]
pub struct InfoPanelEntry {
/// Directory Item containing info like path
pub directory_entry: DirectoryEntry,
Expand Down Expand Up @@ -283,7 +284,7 @@ impl InformationPanel {
if item.is_dir() {
// show folder icon
ui.vertical_centered(|ui| {
ui.label(egui::RichText::from("📁").size(120.0));
ui.label(egui::RichText::from(item.icon()).size(120.0));
});
} else {
// Display file content preview based on its extension
Expand All @@ -306,6 +307,11 @@ impl InformationPanel {
});
}
}
} else {
// if now ext is available, show icon anyway
ui.vertical_centered(|ui| {
ui.label(egui::RichText::from(item.icon()).size(120.0));
});
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/file_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ impl FileDialog {
// we don't restrict the width. It's up to the user to make the UI presentable.
.resizable(true);
if let Some(width) = self.config.right_panel_width {
right_panel = right_panel.min_width(width);
right_panel = right_panel.default_width(width);
}
right_panel.show_inside(ui, |ui| {
f(ui, self);
Expand Down

0 comments on commit 697b398

Please sign in to comment.