Skip to content

v0.10.1

Choose a tag to compare

@github-actions github-actions released this 18 Sep 08:51
· 114 commits to master since this release

Additive Tabs toolbar geometry

No breaking changes. Defaults are identical to 0.10.0: the Md size step is still a 32px-tall box with 16px horizontal padding (a typical label therefore paints a 48px segment), and the Primary tray still insets 4px. The new builders only apply when set.

Signatures

impl TabItem {
    pub fn width(self, w: impl Into<Pixels>) -> Self;
    pub fn height(self, h: impl Into<Pixels>) -> Self;
    pub fn padding_x(self, p: impl Into<Pixels>) -> Self;
}

impl Tabs {
    pub fn list_padding(self, padding: impl Into<Pixels>) -> Self;
    pub fn hover_fill(self, v: bool) -> Self; // default true
}

Reference toolbar shape:

TabItem::new("preview", "Preview")
    .trigger(icon)
    .width(px(32.))
    .height(px(32.))
    .padding_x(px(0.))
// ...
Tabs::new(id, items, "preview")
    .list_padding(px(0.))
    .hover_fill(false)
  • width / height / padding_x are per-tab. An explicit width also wins over full_width for that tab alone and replaces the vertical list's 80px minimum. The sliding indicator measures the fixed box.
  • list_padding overrides the Primary tray's uniform inset (Tabs.List className="p-0"). Secondary already has no inset, so the builder is ignored there.
  • hover_fill(false) drops the unselected-tab wash (the port's translation of v3's opacity-70 overlay) and recolours a hovered unselected label to the theme foreground. SVG triggers still need their own text_color — gpui svgs do not inherit the tab's, so this hover cannot recolour an icon the caller painted explicitly.

The 0.10.0 paint knobs (TabItem::trigger, Tabs::radius / list_bg / indicator_bg / indicator_shadow) are unchanged.

Full Changelog: v0.10.0...v0.10.1