CI: fmt the narrow-layout commits, and Theme::hairline in place of their raw px

This commit is contained in:
ZacharyZhang-NY committed 2026-10-08 21:55:55 -04:00
1 parent 694cccbc81
commit cb5e35f7cb
8 files changed
+69 -21

No files matched your search

+10 -2
View File
@@ -6,9 +6,9 @@ use gpui::{
use smallvec::SmallVec;
use crate::{
typography::Ellipsis,
primitives::{Icon, IconName, Tooltip},
theme::{ActiveTheme, ControlSize, IconSize, Radius, TextSize},
typography::Ellipsis,
};
/// A row of tools, grouped and divided.
@@ -145,7 +145,15 @@ impl RenderOnce for StatusBar {
fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement {
let theme = cx.theme();
// Narrow, both sides shrink and labels end in an ellipsis.
let side = || div().flex().items_center().gap_0p5().h_full().min_w_0().overflow_hidden();
let side = || {
div()
.flex()
.items_center()
.gap_0p5()
.h_full()
.min_w_0()
.overflow_hidden()
};
self.base
.flex()
.flex_none()
+19 -4
View File
@@ -184,11 +184,18 @@ pub struct ZoomControl {
impl ZoomControl {
pub fn new(id: impl Into<ElementId>) -> Self {
Self { id: id.into(), owned: None }
Self {
id: id.into(),
owned: None,
}
}
/// Shows `percent` and hands each press to `on_zoom`.
pub fn owned(mut self, percent: u32, on_zoom: impl Fn(ZoomStep, &mut Window, &mut App) + 'static) -> Self {
pub fn owned(
mut self,
percent: u32,
on_zoom: impl Fn(ZoomStep, &mut Window, &mut App) + 'static,
) -> Self {
self.owned = Some((percent, Rc::new(on_zoom)));
self
}
@@ -263,7 +270,11 @@ fn owned(id: ElementId, percent: u32, on_zoom: OnZoom, cx: &App) -> impl IntoEle
.flex_none()
.items_center()
.gap_0p5()
.child(IconButton::new("zoom-out", IconName::ZoomOut).size(ControlSize::Sm).on_click(press(ZoomStep::Out)))
.child(
IconButton::new("zoom-out", IconName::ZoomOut)
.size(ControlSize::Sm)
.on_click(press(ZoomStep::Out)),
)
.child(
div()
.id("zoom-reset")
@@ -279,7 +290,11 @@ fn owned(id: ElementId, percent: u32, on_zoom: OnZoom, cx: &App) -> impl IntoEle
.child(AnimatedNumber::new("zoom-value", percent as f64).size(TextSize::Sm))
.child(div().text_size(theme.text_size(TextSize::Sm)).child("%")),
)
.child(IconButton::new("zoom-in", IconName::ZoomIn).size(ControlSize::Sm).on_click(press(ZoomStep::In)))
.child(
IconButton::new("zoom-in", IconName::ZoomIn)
.size(ControlSize::Sm)
.on_click(press(ZoomStep::In)),
)
}
#[cfg(test)]