Use user-defined font weight, where appropriate (#13653)

Release Notes:

- N/A
This commit is contained in:
Gilles Peiffer 2024-07-01 15:45:01 +02:00 committed by GitHub
parent 83592306c5
commit 065ab93ca7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 11 deletions

View file

@ -18,9 +18,9 @@ use editor::{
use fs::Fs; use fs::Fs;
use futures::{channel::mpsc, SinkExt, Stream, StreamExt}; use futures::{channel::mpsc, SinkExt, Stream, StreamExt};
use gpui::{ use gpui::{
point, AppContext, EventEmitter, FocusHandle, FocusableView, FontStyle, FontWeight, Global, point, AppContext, EventEmitter, FocusHandle, FocusableView, FontStyle, Global, HighlightStyle,
HighlightStyle, Model, ModelContext, Subscription, Task, TextStyle, UpdateGlobal, View, Model, ModelContext, Subscription, Task, TextStyle, UpdateGlobal, View, ViewContext, WeakView,
ViewContext, WeakView, WhiteSpace, WindowContext, WhiteSpace, WindowContext,
}; };
use language::{Buffer, Point, Selection, TransactionId}; use language::{Buffer, Point, Selection, TransactionId};
use multi_buffer::MultiBufferRow; use multi_buffer::MultiBufferRow;
@ -1730,7 +1730,7 @@ impl PromptEditor {
font_family: settings.ui_font.family.clone(), font_family: settings.ui_font.family.clone(),
font_features: settings.ui_font.features.clone(), font_features: settings.ui_font.features.clone(),
font_size: rems(0.875).into(), font_size: rems(0.875).into(),
font_weight: FontWeight::NORMAL, font_weight: settings.ui_font.weight,
font_style: FontStyle::Normal, font_style: FontStyle::Normal,
line_height: relative(1.3), line_height: relative(1.3),
background_color: None, background_color: None,

View file

@ -1,7 +1,7 @@
use fuzzy::{StringMatch, StringMatchCandidate}; use fuzzy::{StringMatch, StringMatchCandidate};
use gpui::{ use gpui::{
relative, AppContext, BackgroundExecutor, FontStyle, FontWeight, HighlightStyle, StyledText, relative, AppContext, BackgroundExecutor, FontStyle, HighlightStyle, StyledText, TextStyle,
TextStyle, WhiteSpace, WhiteSpace,
}; };
use settings::Settings; use settings::Settings;
use std::ops::Range; use std::ops::Range;
@ -159,7 +159,7 @@ pub fn render_item<T>(
font_family: settings.buffer_font.family.clone(), font_family: settings.buffer_font.family.clone(),
font_features: settings.buffer_font.features.clone(), font_features: settings.buffer_font.features.clone(),
font_size: settings.buffer_font_size(cx).into(), font_size: settings.buffer_font_size(cx).into(),
font_weight: FontWeight::NORMAL, font_weight: settings.buffer_font.weight,
font_style: FontStyle::Normal, font_style: FontStyle::Normal,
line_height: relative(1.), line_height: relative(1.),
background_color: None, background_color: None,

View file

@ -14,9 +14,9 @@ use editor::{
use futures::channel::oneshot; use futures::channel::oneshot;
use gpui::{ use gpui::{
actions, div, impl_actions, Action, AppContext, ClickEvent, EventEmitter, FocusableView, actions, div, impl_actions, Action, AppContext, ClickEvent, EventEmitter, FocusableView,
FontStyle, FontWeight, Hsla, InteractiveElement as _, IntoElement, KeyContext, FontStyle, Hsla, InteractiveElement as _, IntoElement, KeyContext, ParentElement as _, Render,
ParentElement as _, Render, ScrollHandle, Styled, Subscription, Task, TextStyle, View, ScrollHandle, Styled, Subscription, Task, TextStyle, View, ViewContext, VisualContext as _,
ViewContext, VisualContext as _, WhiteSpace, WindowContext, WhiteSpace, WindowContext,
}; };
use project::{ use project::{
search::SearchQuery, search::SearchQuery,
@ -116,7 +116,7 @@ impl BufferSearchBar {
font_family: settings.buffer_font.family.clone(), font_family: settings.buffer_font.family.clone(),
font_features: settings.buffer_font.features.clone(), font_features: settings.buffer_font.features.clone(),
font_size: rems(0.875).into(), font_size: rems(0.875).into(),
font_weight: FontWeight::NORMAL, font_weight: settings.buffer_font.weight,
font_style: FontStyle::Normal, font_style: FontStyle::Normal,
line_height: relative(1.3), line_height: relative(1.3),
background_color: None, background_color: None,