settings_ui: Add prototype for settings controls (#15090)

This PR adds a prototype for controlling settings via the settings UI.

Still staff-shipped.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-07-24 10:36:27 -04:00 committed by GitHub
parent f7d6818c97
commit d540c95c81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 208 additions and 1 deletions

View file

@ -1,3 +1,5 @@
mod theme_settings_ui;
use std::any::TypeId;
use command_palette_hooks::CommandPaletteFilter;
@ -7,6 +9,10 @@ use ui::prelude::*;
use workspace::item::{Item, ItemEvent};
use workspace::Workspace;
use crate::theme_settings_ui::{
BufferFontSizeSetting, EditableSetting, InlineGitBlameSetting, UiFontSizeSetting,
};
pub struct SettingsUiFeatureFlag;
impl FeatureFlag for SettingsUiFeatureFlag {
@ -95,7 +101,7 @@ impl Item for SettingsPage {
}
impl Render for SettingsPage {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
v_flex()
.p_4()
.size_full()
@ -103,5 +109,8 @@ impl Render for SettingsPage {
.child(Label::new(
"Nothing to see here yet. Feature-flagged for staff.",
))
.child(UiFontSizeSetting::new(cx))
.child(BufferFontSizeSetting::new(cx))
.child(InlineGitBlameSetting::new(cx))
}
}