windows: Fix button and checkbox line-height again. (#244)
<img width="1202" src="https://github.com/user-attachments/assets/6741041a-f449-4600-bec1-751841dcec88">
This commit is contained in:
parent
d8ace3c683
commit
55585f9699
3 changed files with 5 additions and 12 deletions
|
|
@ -422,14 +422,7 @@ impl RenderOnce for Button {
|
||||||
this.child(Indicator::new().with_size(self.size))
|
this.child(Indicator::new().with_size(self.size))
|
||||||
})
|
})
|
||||||
.when_some(self.label, |this, label| {
|
.when_some(self.label, |this, label| {
|
||||||
this.child(
|
this.child(div().flex_none().line_height(relative(1.)).child(label))
|
||||||
div()
|
|
||||||
// FIXME: Move down 3px to vertically center the text
|
|
||||||
.mt(px(2.))
|
|
||||||
.flex_none()
|
|
||||||
.line_height(relative(1.))
|
|
||||||
.child(label),
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
.children(self.children)
|
.children(self.children)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use gpui::{
|
use gpui::{
|
||||||
div, prelude::FluentBuilder as _, rems, svg, ElementId, InteractiveElement, IntoElement,
|
div, prelude::FluentBuilder as _, relative, svg, ElementId, InteractiveElement, IntoElement,
|
||||||
ParentElement, RenderOnce, SharedString, StatefulInteractiveElement as _, Styled as _,
|
ParentElement, RenderOnce, SharedString, StatefulInteractiveElement as _, Styled as _,
|
||||||
WindowContext,
|
WindowContext,
|
||||||
};
|
};
|
||||||
|
|
@ -117,7 +117,7 @@ impl RenderOnce for Checkbox {
|
||||||
div()
|
div()
|
||||||
.w_full()
|
.w_full()
|
||||||
.overflow_hidden()
|
.overflow_hidden()
|
||||||
.line_height(rems(1.2))
|
.line_height(relative(1.))
|
||||||
.child(label),
|
.child(label),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use gpui::{
|
use gpui::{
|
||||||
div, prelude::FluentBuilder, rems, svg, CursorStyle, ElementId, InteractiveElement,
|
div, prelude::FluentBuilder, relative, svg, CursorStyle, ElementId, InteractiveElement,
|
||||||
IntoElement, ParentElement, RenderOnce, SharedString, StatefulInteractiveElement, Styled,
|
IntoElement, ParentElement, RenderOnce, SharedString, StatefulInteractiveElement, Styled,
|
||||||
WindowContext,
|
WindowContext,
|
||||||
};
|
};
|
||||||
|
|
@ -91,7 +91,7 @@ impl RenderOnce for Radio {
|
||||||
div()
|
div()
|
||||||
.size_full()
|
.size_full()
|
||||||
.overflow_hidden()
|
.overflow_hidden()
|
||||||
.line_height(rems(1.2))
|
.line_height(relative(1.))
|
||||||
.child(label),
|
.child(label),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue