Files
oak-gpui/crates/image_viewer/src/image_viewer_settings.rs
T
Conrad Irwin b09764c54a settings: Use a derive macro for refine (#38451)
When we refactored settings to not pass JSON blobs around, we ended up
needing
to write *a lot* of code that just merged things (like json merge used
to do).

Use a derive macro to prevent typos in this logic.

Release Notes:

- N/A
2025-09-18 21:13:49 +00:00

21 lines
536 B
Rust

use gpui::App;
pub use settings::ImageFileSizeUnit;
use settings::Settings;
/// The settings for the image viewer.
#[derive(Clone, Debug, Default)]
pub struct ImageViewerSettings {
/// The unit to use for displaying image file sizes.
///
/// Default: "binary"
pub unit: ImageFileSizeUnit,
}
impl Settings for ImageViewerSettings {
fn from_settings(content: &settings::SettingsContent, _cx: &mut App) -> Self {
Self {
unit: content.image_viewer.clone().unwrap().unit.unwrap(),
}
}
}