Checkpoint: Thread WindowContext through to user_settings

This commit is contained in:
Marshall Bowers 2023-10-19 12:58:17 -04:00
parent b16d37953d
commit 61e09ff532
15 changed files with 71 additions and 64 deletions

View file

@ -149,11 +149,11 @@ impl<S: 'static + Send + Sync + Clone> Button<S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let icon_color = self.icon_color();
let border_color = self.border_color(cx);
let setting = user_settings();
let settings = user_settings(cx);
let mut el = h_stack()
.p_1()
.text_size(ui_size(1.))
.text_size(ui_size(cx, 1.))
.rounded_md()
.border()
.border_color(border_color)

View file

@ -180,8 +180,8 @@ impl<S: 'static + Send + Sync> IconElement<S> {
let theme = theme(cx);
let fill = self.color.color(theme);
let svg_size = match self.size {
IconSize::Small => ui_size(12. / 14.),
IconSize::Medium => ui_size(15. / 14.),
IconSize::Small => ui_size(cx, 12. / 14.),
IconSize::Medium => ui_size(cx, 15. / 14.),
};
svg()

View file

@ -96,7 +96,7 @@ impl<S: 'static + Send + Sync + Clone> Label<S> {
.bg(LabelColor::Hidden.hsla(cx)),
)
})
.text_size(ui_size(1.))
.text_size(ui_size(cx, 1.))
.when(self.line_height_style == LineHeightStyle::UILabel, |this| {
this.line_height(relative(1.))
})