
This PR adds file icons (like in tabs, the project panel and tab switcher) to the file finder popup. It's similar to [tab_switcher icons](https://github.com/zed-industries/zed/pull/17115), but simpler, because we're only dealing with actual files. Release Notes: - Added icons to the file finder. Screenshot:  --------- Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
27 lines
767 B
Rust
27 lines
767 B
Rust
use anyhow::Result;
|
|
use schemars::JsonSchema;
|
|
use serde_derive::{Deserialize, Serialize};
|
|
use settings::{Settings, SettingsSources};
|
|
|
|
#[derive(Deserialize, Debug, Clone, Copy, PartialEq)]
|
|
pub struct FileFinderSettings {
|
|
pub file_icons: bool,
|
|
}
|
|
|
|
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
|
|
pub struct FileFinderSettingsContent {
|
|
/// Whether to show file icons in the file finder.
|
|
///
|
|
/// Default: true
|
|
pub file_icons: Option<bool>,
|
|
}
|
|
|
|
impl Settings for FileFinderSettings {
|
|
const KEY: Option<&'static str> = Some("file_finder");
|
|
|
|
type FileContent = FileFinderSettingsContent;
|
|
|
|
fn load(sources: SettingsSources<Self::FileContent>, _: &mut gpui::AppContext) -> Result<Self> {
|
|
sources.json_merge()
|
|
}
|
|
}
|