Make tab close button square (#4052)

This PR makes the close button for tabs square.

`IconButton` now accepts a `shape`, and using `IconButtonShape::Square`
will ensure the `IconButton` is square with respect to its contained
icon.

#### Before

<img width="119" alt="Screenshot 2024-01-15 at 10 32 40 AM"
src="https://github.com/zed-industries/zed/assets/1486634/dc806b9b-411f-4cd9-8c10-676d2cbd298b">

#### After

<img width="116" alt="Screenshot 2024-01-15 at 10 32 24 AM"
src="https://github.com/zed-industries/zed/assets/1486634/8b4ef43c-14b6-449f-a235-5d7affd82c4e">

Release Notes:

- Changed the tab close button to be square.
This commit is contained in:
Marshall Bowers
2024-01-15 10:43:03 -05:00
committed by GitHub
parent 1da9c8b1e9
commit b136d21ebf
4 changed files with 43 additions and 13 deletions
+2 -1
View File
@@ -3,7 +3,7 @@ use std::cmp::Ordering;
use gpui::Render;
use story::Story;
use crate::{prelude::*, TabPosition};
use crate::{prelude::*, IconButtonShape, TabPosition};
use crate::{Indicator, Tab};
pub struct TabStory;
@@ -28,6 +28,7 @@ impl Render for TabStory {
Tab::new("tab_1")
.end_slot(
IconButton::new("close_button", IconName::Close)
.shape(IconButtonShape::Square)
.icon_color(Color::Muted)
.size(ButtonSize::None)
.icon_size(IconSize::XSmall),