file_finder: Display file icons (#18091)
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>
This commit is contained in:
parent
5d12e3ce3a
commit
7dac5594cd
5 changed files with 57 additions and 2 deletions
27
crates/file_finder/src/file_finder_settings.rs
Normal file
27
crates/file_finder/src/file_finder_settings.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
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()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue