Compare commits
1 Commits
zeta2_edit
...
update-use
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd676ffc4d |
@@ -254,9 +254,9 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
),
|
||||
metadata: None,
|
||||
}),
|
||||
SettingsPageItem::SectionHeader("Fonts"),
|
||||
SettingsPageItem::SectionHeader("Buffer Font"),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Buffer Font Family",
|
||||
title: "Font Family",
|
||||
description: "Font family for editor text",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.theme.buffer_font_family,
|
||||
@@ -266,7 +266,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Buffer Font Size",
|
||||
title: "Font Size",
|
||||
description: "Font size for editor text",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.theme.buffer_font_size,
|
||||
@@ -276,7 +276,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Buffer Font Weight",
|
||||
title: "Font Weight",
|
||||
description: "Font weight for editor text (100-900)",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.theme.buffer_font_weight,
|
||||
@@ -288,7 +288,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
// todo(settings_ui): This needs custom ui
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
files: USER,
|
||||
title: "Buffer Line Height",
|
||||
title: "Line Height",
|
||||
description: "Line height for editor text",
|
||||
field: Box::new(
|
||||
SettingField {
|
||||
@@ -303,7 +303,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
files: USER,
|
||||
title: "Buffer Font Features",
|
||||
title: "Font Features",
|
||||
description: "The OpenType features to enable for rendering in text buffers.",
|
||||
field: Box::new(
|
||||
SettingField {
|
||||
@@ -318,7 +318,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
files: USER,
|
||||
title: "Buffer Font Fallbacks",
|
||||
title: "Font Fallbacks",
|
||||
description: "The font fallbacks to use for rendering in text buffers.",
|
||||
field: Box::new(
|
||||
SettingField {
|
||||
@@ -331,8 +331,9 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
),
|
||||
metadata: None,
|
||||
}),
|
||||
SettingsPageItem::SectionHeader("UI Font"),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "UI Font Family",
|
||||
title: "Font Family",
|
||||
description: "Font family for UI elements",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.theme.ui_font_family,
|
||||
@@ -342,7 +343,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "UI Font Size",
|
||||
title: "Font Size",
|
||||
description: "Font size for UI elements",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.theme.ui_font_size,
|
||||
@@ -352,7 +353,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "UI Font Weight",
|
||||
title: "Font Weight",
|
||||
description: "Font weight for UI elements (100-900)",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.theme.ui_font_weight,
|
||||
@@ -363,7 +364,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
files: USER,
|
||||
title: "UI Font Features",
|
||||
title: "Font Features",
|
||||
description: "The OpenType features to enable for rendering in UI elements.",
|
||||
field: Box::new(
|
||||
SettingField {
|
||||
@@ -378,7 +379,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
files: USER,
|
||||
title: "UI Font Fallbacks",
|
||||
title: "Font Fallbacks",
|
||||
description: "The font fallbacks to use for rendering in the UI.",
|
||||
field: Box::new(
|
||||
SettingField {
|
||||
@@ -391,8 +392,9 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
),
|
||||
metadata: None,
|
||||
}),
|
||||
SettingsPageItem::SectionHeader("Agent Panel Font"),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Agent Panel UI Font Size",
|
||||
title: "UI Font Size",
|
||||
description: "Font size for agent response text in the agent panel. Falls back to the regular UI font size.",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| {
|
||||
@@ -408,7 +410,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Agent Panel Buffer Font Size",
|
||||
title: "Buffer Font Size",
|
||||
description: "Font size for user messages text in the agent panel",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.theme.agent_buffer_font_size,
|
||||
@@ -419,6 +421,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
metadata: None,
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SectionHeader("Cursor"),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Multi Cursor Modifier",
|
||||
description: "Modifier key for adding multiple cursors",
|
||||
@@ -431,7 +434,6 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
metadata: None,
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SectionHeader("Cursor"),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Cursor Blink",
|
||||
description: "Whether the cursor blinks in the editor",
|
||||
@@ -808,9 +810,9 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
metadata: None,
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SectionHeader("Hover"),
|
||||
SettingsPageItem::SectionHeader("Hover Popover"),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Hover Popover Enabled",
|
||||
title: "Enabled",
|
||||
description: "Show the informational hover box when moving the mouse over symbols in the editor",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.editor.hover_popover_enabled,
|
||||
@@ -823,7 +825,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
}),
|
||||
// todo(settings ui): add units to this number input
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Hover Popover Delay",
|
||||
title: "Delay",
|
||||
description: "Time to wait in milliseconds before showing the informational hover box",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.editor.hover_popover_delay,
|
||||
@@ -834,21 +836,9 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
metadata: None,
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SectionHeader("Code Actions & Selection"),
|
||||
SettingsPageItem::SectionHeader("Drag And Drop Selection"),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Inline Code Actions",
|
||||
description: "Show code action button at start of buffer line",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.editor.inline_code_actions,
|
||||
pick_mut: |settings_content| {
|
||||
&mut settings_content.editor.inline_code_actions
|
||||
},
|
||||
}),
|
||||
metadata: None,
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Drag And Drop Selection",
|
||||
title: "Enabled",
|
||||
description: "Enable drag and drop selection",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| {
|
||||
@@ -872,7 +862,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Drag And Drop Selection Delay",
|
||||
title: "Delay",
|
||||
description: "Delay in milliseconds before drag and drop selection starts",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| {
|
||||
@@ -1014,6 +1004,18 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
|
||||
metadata: None,
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Inline Code Actions",
|
||||
description: "Show code action button at start of buffer line",
|
||||
field: Box::new(SettingField {
|
||||
pick: |settings_content| &settings_content.editor.inline_code_actions,
|
||||
pick_mut: |settings_content| {
|
||||
&mut settings_content.editor.inline_code_actions
|
||||
},
|
||||
}),
|
||||
metadata: None,
|
||||
files: USER,
|
||||
}),
|
||||
SettingsPageItem::SectionHeader("Scrollbar"),
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Show",
|
||||
|
||||
@@ -15,7 +15,7 @@ use heck::ToTitleCase as _;
|
||||
use project::WorktreeId;
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
use settings::{SettingsContent, SettingsStore};
|
||||
use settings::{Settings, SettingsContent, SettingsStore};
|
||||
use std::{
|
||||
any::{Any, TypeId, type_name},
|
||||
cell::RefCell,
|
||||
@@ -466,6 +466,13 @@ pub fn open_settings_editor(
|
||||
// We have to defer this to get the workspace off the stack.
|
||||
|
||||
cx.defer(move |cx| {
|
||||
let current_rem_size: f32 = theme::ThemeSettings::get_global(cx).ui_font_size(cx).into();
|
||||
|
||||
let default_bounds = size(px(900.), px(750.)); // 4:3 Aspect Ratio
|
||||
let default_rem_size = 16.0;
|
||||
let scale_factor = current_rem_size / default_rem_size;
|
||||
let scaled_bounds: gpui::Size<Pixels> = default_bounds.map(|axis| axis * scale_factor);
|
||||
|
||||
cx.open_window(
|
||||
WindowOptions {
|
||||
titlebar: Some(TitlebarOptions {
|
||||
@@ -478,8 +485,8 @@ pub fn open_settings_editor(
|
||||
is_movable: true,
|
||||
kind: gpui::WindowKind::Floating,
|
||||
window_background: cx.theme().window_background_appearance(),
|
||||
window_min_size: Some(size(px(900.), px(750.))), // 4:3 Aspect Ratio
|
||||
window_bounds: Some(WindowBounds::centered(size(px(900.), px(750.)), cx)),
|
||||
window_min_size: Some(scaled_bounds),
|
||||
window_bounds: Some(WindowBounds::centered(scaled_bounds, cx)),
|
||||
..Default::default()
|
||||
},
|
||||
|window, cx| cx.new(|cx| SettingsWindow::new(Some(workspace_handle), window, cx)),
|
||||
@@ -1701,7 +1708,7 @@ impl SettingsWindow {
|
||||
};
|
||||
|
||||
v_flex()
|
||||
.w_64()
|
||||
.w_56()
|
||||
.p_2p5()
|
||||
.when(cfg!(target_os = "macos"), |c| c.pt_10())
|
||||
.h_full()
|
||||
@@ -2136,7 +2143,7 @@ impl SettingsWindow {
|
||||
}
|
||||
|
||||
return v_flex()
|
||||
.size_full()
|
||||
.flex_1()
|
||||
.pt_6()
|
||||
.pb_8()
|
||||
.px_8()
|
||||
|
||||
@@ -757,20 +757,13 @@ impl TitleBar {
|
||||
this.trigger_with_tooltip(
|
||||
ButtonLike::new("user-menu")
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_0p5()
|
||||
.children(
|
||||
TitleBarSettings::get_global(cx)
|
||||
.show_user_picture
|
||||
.then(|| user_avatar.clone())
|
||||
.flatten()
|
||||
.map(|avatar| Avatar::new(avatar)),
|
||||
)
|
||||
.child(
|
||||
Icon::new(IconName::ChevronDown)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Muted),
|
||||
),
|
||||
h_flex().gap_0p5().mr_1().children(
|
||||
TitleBarSettings::get_global(cx)
|
||||
.show_user_picture
|
||||
.then(|| user_avatar.clone())
|
||||
.flatten()
|
||||
.map(|avatar| Avatar::new(avatar)),
|
||||
),
|
||||
)
|
||||
.style(ButtonStyle::Subtle),
|
||||
Tooltip::text("Toggle User Menu"),
|
||||
|
||||
Reference in New Issue
Block a user