1use gpui::App;
4use theme::ActiveTheme;
5
6mod apca_contrast;
7mod color_contrast;
8mod constants;
9mod corner_solver;
10mod format_distance;
11mod fuzzy_match;
12mod search_input;
13mod with_rem_size;
14
15pub use apca_contrast::*;
16pub use color_contrast::*;
17pub use constants::*;
18pub use corner_solver::{CornerSolver, inner_corner_radius};
19pub use format_distance::*;
20pub use fuzzy_match::*;
21pub use search_input::*;
22pub use with_rem_size::*;
23
24pub fn is_light(cx: &mut App) -> bool {
26 cx.theme().appearance.is_light()
27}
28
29pub fn reveal_in_file_manager_label(is_remote: bool) -> &'static str {
31 if cfg!(target_os = "macos") && !is_remote {
32 "Reveal in Finder"
33 } else if cfg!(target_os = "windows") && !is_remote {
34 "Reveal in File Explorer"
35 } else {
36 "Reveal in File Manager"
37 }
38}
39
40pub fn capitalize(str: &str) -> String {
55 let mut chars = str.chars();
56 match chars.next() {
57 None => String::new(),
58 Some(first_char) => first_char.to_uppercase().collect::<String>() + chars.as_str(),
59 }
60}