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.

settings: add toggle for sidebar icon rail

Konstantin Pertsev01dc2c36d894
diff --git a/crates/rf-app/src/i18n_en.rs b/crates/rf-app/src/i18n_en.rs
index 210b9d39..5828dbc5 100644
--- a/crates/rf-app/src/i18n_en.rs
+++ b/crates/rf-app/src/i18n_en.rs
@@ -2516,4 +2516,6 @@ pub const EN: &[(&str, &str)] = &[
("Yerel diskler", "Local disks"),
("Çıkarılabilir sürücüler", "Removable drives"),
("Ağ sürücüleri", "Network drives"),
+ ("Kenar çubuğu simge şeridi", "Sidebar icon rail"),
+ ("Açıkken kenar çubuğu dar bir simge şeridine dönüşür ve üstüne gelince açılır. Kenarını sürükleyerek de değiştirebilirsiniz.", "When on, collapses the sidebar into a narrow icon rail that slides out on hover. You can also drag its edge to switch."),
];
diff --git a/crates/rf-app/src/settings_view.rs b/crates/rf-app/src/settings_view.rs
index f6d55fb3..572942e9 100644
--- a/crates/rf-app/src/settings_view.rs
+++ b/crates/rf-app/src/settings_view.rs
@@ -2162,6 +2162,13 @@ fn appearance(p: &Palette, s: &Settings, cx: &mut App) -> Vec<AnyElement> {
Some(t!("Kenar çubuğunun satırları incelir, kaydırmadan daha çok yer görünür")),
sw("sidebar-compact", p, s.sidebar_compact, |s, v| s.sidebar_compact = v),
)),
+ (AppearanceGroup::Sidebar, card(
+ p,
+ L::PanelLeft,
+ t!("Kenar çubuğu simge şeridi"),
+ Some(t!("Açıkken kenar çubuğu dar bir simge şeridine dönüşür ve üstüne gelince açılır. Kenarını sürükleyerek de değiştirebilirsiniz.")),
+ sw("sidebar-rail", p, s.sidebar_rail, |s, v| s.sidebar_rail = v),
+ )),
(AppearanceGroup::Files, card(
p,
L::Rows2,
@@ -5085,6 +5092,23 @@ mod search_tests {
assert!(titles(" ").is_empty());
}
+ #[test]
+ fn sidebar_rail_setting_is_searchable_by_rail_and_sidebar() {
+ for lang in [crate::i18n::Lang::Tr, crate::i18n::Lang::En] {
+ crate::i18n::set(lang);
+ let entry = Found {
+ title: crate::t!("Kenar çubuğu simge şeridi").into(),
+ desc: Some(crate::t!("Açıkken kenar çubuğu dar bir simge şeridine dönüşür ve üstüne gelince açılır. Kenarını sürükleyerek de değiştirebilirsiniz.").into()),
+ page: Page::Appearance,
+ expander: None,
+ };
+ for q in ["rail", "sidebar", "icon rail"] {
+ assert_eq!(matching(vec![entry.clone()], q).len(), 1, "query {q:?} missed in {lang:?}");
+ }
+ }
+ crate::i18n::set(crate::i18n::Lang::Tr);
+ }
+
/// Builds the Dock page the way the search does (the builders note their texts) and returns what was noted.
fn noted_on_the_dock_page(s: &Settings, p: &Palette) -> Vec<Found> {
COLLECT.with(|c| *c.borrow_mut() = Some(Vec::new()));
diff --git a/crates/rf-app/src/workspace.rs b/crates/rf-app/src/workspace.rs
index e7bd3aa3..de25ac38 100644
--- a/crates/rf-app/src/workspace.rs
+++ b/crates/rf-app/src/workspace.rs
@@ -1032,7 +1032,12 @@ impl Workspace {
// a file dialog keeps its own preview state (`picker_preview_open`)
if this.picker.is_none() {
this.preview_open = s.preview_open;
- this.sidebar_rail = s.sidebar_rail;
+ if this.sidebar_rail != s.sidebar_rail {
+ this.sidebar_rail = s.sidebar_rail;
+ this.rail_peek = [false; 2];
+ this.rail_peek_open = false;
+ this.rail_peek_closing = false;
+ }
}
this.sidebar_open = s.sidebar_open;
cx.notify();