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.

Dual pane: each pane's path above it; libraries open to their folders

gelenmedya00c78f42c6b5
diff --git a/crates/rf-app/src/i18n_en.rs b/crates/rf-app/src/i18n_en.rs
index 64a70e26..acf5114e 100644
--- a/crates/rf-app/src/i18n_en.rs
+++ b/crates/rf-app/src/i18n_en.rs
@@ -2331,6 +2331,8 @@ pub const EN: &[(&str, &str)] = &[
("Gelen dosyaların klasörünü seçin", "Choose the folder for received files"),
("İndirme klasörü", "Download folder"),
("İndirmelerin klasörünü seçin", "Choose the folder for downloads"),
+ ("Çift bölmede her bölmenin yolu", "Each pane's path in dual pane"),
+ ("Her bölmenin üstünde kendi klasörünün yolu durur; adres çubuğu yalnızca etkin bölmeninkini gösterir", "Each pane shows its own folder's path above it; the address bar shows only the active pane's"),
("Bu sürücü BitLocker ile kilitli. Kilidini açmak için Windows'un parola penceresi açıldı.", "This drive is locked by BitLocker. Windows' password window opened to unlock it."),
("Git durumunu göster", "Show Git status"),
("Depoların içinde dosyaların Git durumu, adın yanındaki işaret ve commit sütunları; kapalıyken liste için Git hiç çalıştırılmaz", "Files' Git status inside repositories, the mark after a name and the commit columns; when off, Git is never run for the list"),
diff --git a/crates/rf-app/src/settings.rs b/crates/rf-app/src/settings.rs
index 8694ea3f..dfbbe9f6 100644
--- a/crates/rf-app/src/settings.rs
+++ b/crates/rf-app/src/settings.rs
@@ -758,6 +758,9 @@ pub struct Settings {
pub dual_pane_new_tabs: bool,
/// Dual pane side by side (true) or stacked (false).
pub dual_pane_vertical: bool,
+ /// In dual pane, each pane shows its own folder's path above it (on): the address bar shows only the active pane's, and to see
+ /// where the other one is one had to switch to it (Discussion 732).
+ pub dual_pane_paths: bool,
/// The share of the tab the first pane takes (the left one, or the upper one when stacked): the divider between the two panes is
/// dragged (issue 284: "I kept trying to drag the middle divider, but I cannot"). 0.5 is the middle.
pub dual_pane_split: f32,
@@ -1281,6 +1284,7 @@ impl Default for Settings {
sessions_in_this_window: false,
dual_pane_new_tabs: false,
dual_pane_vertical: true,
+ dual_pane_paths: true,
dual_pane_split: 0.5,
menu: MenuPrefs::default(),
smooth_scroll: true,
diff --git a/crates/rf-app/src/settings_view.rs b/crates/rf-app/src/settings_view.rs
index 1a84446d..4b03bc62 100644
--- a/crates/rf-app/src/settings_view.rs
+++ b/crates/rf-app/src/settings_view.rs
@@ -1148,6 +1148,13 @@ fn general(p: &Palette, s: &Settings, cx: &mut App) -> Vec<AnyElement> {
v.push(section(p, t!("Çift bölme")));
v.push(card(p, L::Columns2, t!("Yeni sekmeleri çift bölmeyle aç"), None, sw("dual-new", p, s.dual_pane_new_tabs, |s, v| s.dual_pane_new_tabs = v)));
+ v.push(card(
+ p,
+ L::FolderOpen,
+ t!("Çift bölmede her bölmenin yolu"),
+ Some(t!("Her bölmenin üstünde kendi klasörünün yolu durur; adres çubuğu yalnızca etkin bölmeninkini gösterir")),
+ sw("dual-paths", p, s.dual_pane_paths, |s, v| s.dual_pane_paths = v),
+ ));
v.push(card(
p,
L::SquareSplitHorizontal,
diff --git a/crates/rf-app/src/workspace.rs b/crates/rf-app/src/workspace.rs
index cbf1d30b..23fad1d1 100644
--- a/crates/rf-app/src/workspace.rs
+++ b/crates/rf-app/src/workspace.rs
@@ -217,6 +217,8 @@ pub struct Workspace {
sidebar_ext_drag: bool,
/// The sidebar's folder tree (empty unless the setting is on).
side_tree: sidebar_tree::Holder,
+ /// The libraries opened in the sidebar to their folders (Discussion 710), by their `.library-ms` file.
+ open_libraries: std::collections::HashSet<PathBuf>,
/// This window answers another app's Open/Save dialog (see `picker`).
picker: Option<std::rc::Rc<crate::picker::PickSession>>,
/// Counts the dialog's size changes: only the last one is kept (`set_picker`).
@@ -1105,6 +1107,7 @@ impl Workspace {
drag_hover_tab: None,
sidebar_ext_drag: false,
side_tree: Default::default(),
+ open_libraries: Default::default(),
picker: None,
picker_size_gen: 0,
viewport_w: 1300.,
@@ -4917,7 +4920,41 @@ impl Workspace {
for (i, l) in libraries.into_iter().enumerate() {
let loc = Location::Library { file: l.file.clone(), name: l.name.clone() };
let active = cur == loc;
- col = col.child(self.sidebar_item(("sb-lib", i).into(), L::Library, p.accent, l.name, loc, active, false, None, p, cx, crate::icon_theme::FOLDER_NAMES));
+ // a library opens to its folders as in Explorer's tree (Discussion 710)
+ let open = self.open_libraries.contains(&l.file);
+ let toggle = (!l.folders.is_empty()).then(|| {
+ let file = l.file.clone();
+ div()
+ .id(("sb-lib-open", i))
+ .size(px(20.))
+ .flex()
+ .items_center()
+ .justify_center()
+ .rounded(px(4.))
+ .hover(|d| d.bg(p.hover))
+ .child(Icon::new(if open { L::ChevronDown } else { L::ChevronRight }).size(px(12.)).text_color(p.text_tertiary))
+ .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation())
+ .on_click(cx.listener(move |this, _, _, cx| {
+ if !this.open_libraries.remove(&file) {
+ this.open_libraries.insert(file.clone());
+ }
+ cx.stop_propagation();
+ cx.notify();
+ }))
+ .into_any_element()
+ });
+ // (the chevron stands on the row's right, over it: the row's own extra slot is the line under the name)
+ let row = self.sidebar_item(("sb-lib", i).into(), L::Library, p.accent, l.name, loc, active, false, None, p, cx, crate::icon_theme::FOLDER_NAMES);
+ col = col.child(div().relative().child(row).children(toggle.map(|t| div().absolute().right(px(10.)).top_0().bottom_0().flex().items_center().child(t))));
+ if open {
+ for (j, folder) in l.folders.iter().enumerate() {
+ let floc = Location::Path(folder.clone());
+ let factive = cur == floc;
+ let name = rf_core::history::display_name(folder);
+ let row = self.sidebar_item(("sb-lib-f", i * 1000 + j).into(), L::Folder, p.text_secondary, name, floc, factive, false, None, p, cx, crate::icon_theme::FOLDER_NAMES);
+ col = col.child(div().pl(px(16.)).child(row));
+ }
+ }
}
}
let network = self.places.read(cx).network.clone();
@@ -6283,7 +6320,27 @@ impl Render for Workspace {
let side_by_side = cx.global::<crate::settings::Settings>().dual_pane_vertical;
// (a share the file holds that is no number, or out of range, is the middle)
let split = Some(cx.global::<crate::settings::Settings>().dual_pane_split).filter(|s| s.is_finite()).map_or(0.5, |s| s.clamp(SPLIT_MIN, SPLIT_MAX));
+ let show_paths = cx.global::<crate::settings::Settings>().dual_pane_paths;
let pane = |view: Entity<FolderView>, is_right: bool, active: bool, cx: &mut Context<Self>| {
+ // the pane's own folder above it (Discussion 732): the address bar shows only the active pane's
+ let path_strip = show_paths.then(|| {
+ let v = view.read(cx);
+ let text = v.location().path().map(|p| p.display().to_string()).unwrap_or_else(|| v.title(cx));
+ div()
+ .flex_none()
+ .h(px(24.))
+ .px_3()
+ .flex()
+ .items_center()
+ .border_b_1()
+ .border_color(p.divider)
+ .text_xs()
+ .text_color(if active { p.text } else { p.text_secondary })
+ .overflow_hidden()
+ .whitespace_nowrap()
+ .text_ellipsis()
+ .child(text)
+ });
div()
// the first pane has its share, the second what is left
.map(|d| match (is_right, side_by_side) {
@@ -6303,7 +6360,8 @@ impl Render for Workspace {
}
this.set_active_pane(is_right, cx)
}))
- .child(view)
+ .when_some(path_strip, |d, strip| d.flex().flex_col().child(strip).child(div().flex_1().min_h_0().child(view.clone())))
+ .when(!show_paths, |d| d.child(view.clone()))
.when(active, |d| {
d.child(div().absolute().top_0().left_0().right_0().h(px(2.)).bg(p.accent))
})