settings_ui: Add UI and buffer font weight controls (#15104)

This PR adds settings controls for the UI and buffer font weight
settings.

It also does some work around grouping the settings into related
sections.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-07-24 14:09:13 -04:00 committed by GitHub
parent 7fb906d774
commit 274e56b086
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 557 additions and 272 deletions

View file

@ -1,17 +1,16 @@
mod theme_settings_ui;
mod theme_settings_controls;
use std::any::TypeId;
use command_palette_hooks::CommandPaletteFilter;
use editor::EditorSettingsControls;
use feature_flags::{FeatureFlag, FeatureFlagViewExt};
use gpui::{actions, AppContext, EventEmitter, FocusHandle, FocusableView, View};
use ui::prelude::*;
use workspace::item::{Item, ItemEvent};
use workspace::Workspace;
use crate::theme_settings_ui::{
BufferFontSizeSetting, EditableSetting, InlineGitBlameSetting, UiFontSizeSetting,
};
use crate::theme_settings_controls::ThemeSettingsControls;
pub struct SettingsUiFeatureFlag;
@ -101,16 +100,23 @@ 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()
.gap_4()
.child(Label::new("Settings").size(LabelSize::Large))
.child(Label::new(
"Nothing to see here yet. Feature-flagged for staff.",
))
.child(UiFontSizeSetting::new(cx))
.child(BufferFontSizeSetting::new(cx))
.child(InlineGitBlameSetting::new(cx))
.child(
v_flex()
.gap_1()
.child(Label::new("Appearance"))
.child(ThemeSettingsControls::new()),
)
.child(
v_flex()
.gap_1()
.child(Label::new("Editor"))
.child(EditorSettingsControls::new()),
)
}
}