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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 13 deletions

View file

@ -32,8 +32,8 @@ use std::{
use theme::ThemeSettings;
use ui::{
prelude::*, right_click_menu, ButtonSize, Color, IconButton, IconName, IconSize, Indicator,
Label, Tab, TabBar, TabPosition, Tooltip,
prelude::*, right_click_menu, ButtonSize, Color, IconButton, IconButtonShape, IconName,
IconSize, Indicator, Label, Tab, TabBar, TabPosition, Tooltip,
};
use ui::{v_stack, ContextMenu};
use util::{maybe, truncate_and_remove_front, ResultExt};
@ -1341,6 +1341,7 @@ impl Pane {
.start_slot::<Indicator>(indicator)
.end_slot(
IconButton::new("close tab", IconName::Close)
.shape(IconButtonShape::Square)
.icon_color(Color::Muted)
.size(ButtonSize::None)
.icon_size(IconSize::XSmall)