Update model selector (#15665)

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Nate Butler
2024-08-01 21:57:51 -04:00
committed by GitHub
co-authored by Marshall Bowers
parent 5e011ab029
commit b4dcd6d394
15 changed files with 130 additions and 10 deletions
+10
View File
@@ -106,6 +106,11 @@ impl IconSize {
)]
pub enum IconName {
Ai,
AiAnthropic,
AiOpenAi,
AiGoogle,
AiOllama,
AiZed,
ArrowCircle,
ArrowDown,
ArrowDownFromLine,
@@ -262,6 +267,11 @@ impl IconName {
pub fn path(self) -> &'static str {
match self {
IconName::Ai => "icons/ai.svg",
IconName::AiAnthropic => "icons/ai_anthropic.svg",
IconName::AiOpenAi => "icons/ai_open_ai.svg",
IconName::AiGoogle => "icons/ai_google.svg",
IconName::AiOllama => "icons/ai_ollama.svg",
IconName::AiZed => "icons/ai_zed.svg",
IconName::ArrowCircle => "icons/arrow_circle.svg",
IconName::ArrowDown => "icons/arrow_down.svg",
IconName::ArrowDownFromLine => "icons/arrow_down_from_line.svg",
+16
View File
@@ -8,6 +8,22 @@ use crate::{rems_from_px, Color};
/// Extends [`gpui::Styled`] with typography-related styling methods.
pub trait StyledTypography: Styled + Sized {
/// Sets the font family to the buffer font.
fn font_buffer(self, cx: &WindowContext) -> Self {
let settings = ThemeSettings::get_global(cx);
let buffer_font_family = settings.buffer_font.family.clone();
self.font_family(buffer_font_family)
}
/// Sets the font family to the UI font.
fn font_ui(self, cx: &WindowContext) -> Self {
let settings = ThemeSettings::get_global(cx);
let ui_font_family = settings.ui_font.family.clone();
self.font_family(ui_font_family)
}
/// Sets the text size using a [`UiTextSize`].
fn text_ui_size(self, size: TextSize, cx: &WindowContext) -> Self {
self.text_size(size.rems(cx))