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:

![image](https://github.com/user-attachments/assets/bd6a54c1-cdbd-415a-9a82-0cc7a0bb6ca2)

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Daste 2024-09-20 20:44:13 +02:00 committed by GitHub
parent 5d12e3ce3a
commit 7dac5594cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 57 additions and 2 deletions

View 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()
}
}