Merge branch 'main' into n/t2

This commit is contained in:
Nate Butler
2023-11-01 16:52:43 -04:00
56 changed files with 17406 additions and 4298 deletions
+5 -5
View File
@@ -1,9 +1,9 @@
use std::sync::Arc;
use gpui2::{div, DefiniteLength, Hsla, MouseButton, WindowContext};
use gpui2::{div, rems, DefiniteLength, Hsla, MouseButton, WindowContext};
use crate::{h_stack, Icon, IconColor, IconElement, Label, LabelColor};
use crate::{prelude::*, LineHeightStyle};
use crate::prelude::*;
use crate::{h_stack, Icon, IconColor, IconElement, Label, LabelColor, LineHeightStyle};
#[derive(Default, PartialEq, Clone, Copy)]
pub enum IconPosition {
@@ -151,7 +151,7 @@ impl<V: 'static> Button<V> {
.relative()
.id(SharedString::from(format!("{}", self.label)))
.p_1()
.text_size(ui_size(cx, 1.))
.text_size(rems(1.))
.rounded_md()
.bg(self.variant.bg_color(cx))
.hover(|style| style.bg(self.variant.bg_color_hover(cx)))
@@ -198,7 +198,7 @@ impl<V: 'static> ButtonGroup<V> {
}
fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let mut el = h_stack().text_size(ui_size(cx, 1.));
let mut el = h_stack().text_size(rems(1.));
for button in self.buttons {
el = el.child(button.render(_view, cx));
+3 -3
View File
@@ -1,4 +1,4 @@
use gpui2::{svg, Hsla};
use gpui2::{rems, svg, Hsla};
use strum::EnumIter;
use crate::prelude::*;
@@ -184,8 +184,8 @@ impl IconElement {
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let fill = self.color.color(cx);
let svg_size = match self.size {
IconSize::Small => ui_size(cx, 12. / 14.),
IconSize::Medium => ui_size(cx, 15. / 14.),
IconSize::Small => rems(0.75),
IconSize::Medium => rems(0.9375),
};
svg()
+2 -2
View File
@@ -1,4 +1,4 @@
use gpui2::{relative, Hsla, WindowContext};
use gpui2::{relative, rems, Hsla, WindowContext};
use smallvec::SmallVec;
use crate::prelude::*;
@@ -85,7 +85,7 @@ impl Label {
.bg(LabelColor::Hidden.hsla(cx)),
)
})
.text_size(ui_size(cx, 1.))
.text_size(rems(1.))
.when(self.line_height_style == LineHeightStyle::UILabel, |this| {
this.line_height(relative(1.))
})