Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

Preview pane: a shown text needs no big type icon above it (800)

gelenmedya0381e8d2b8d7
diff --git a/crates/rf-app/src/preview.rs b/crates/rf-app/src/preview.rs
index 00e79ccf..d4bc2572 100644
--- a/crates/rf-app/src/preview.rs
+++ b/crates/rf-app/src/preview.rs
@@ -1160,8 +1160,10 @@ impl Render for Preview {
.child(visual)
.into_any_element()
};
+ // a text file whose text is shown: no big type icon above it, the text takes the room (issue 800)
+ let text_only = !playable && !icons::has_thumbnail(&e) && self.text.as_ref().is_some_and(|(tp, _)| *tp == path);
col = col
- .child(visual_box)
+ .when(!text_only, |c| c.child(visual_box))
.when(playable, |c| c.child(self.render_player_bar(&p, video, cx)))
.child(
div()
@@ -1177,7 +1179,7 @@ impl Render for Preview {
div()
.id("preview-text")
.w_full()
- .max_h(px(360.))
+ .max_h(px(if text_only { 640. } else { 360. }))
.overflow_y_scroll()
.p_2()
.rounded(theme::RADIUS_SM)