mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-13 05:42:59 +00:00
Lighten tab close button when clicked
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
8c51bb253d
commit
bc1f758b66
1 changed files with 8 additions and 1 deletions
|
@ -293,13 +293,20 @@ impl Pane {
|
||||||
enum TabCloseButton {}
|
enum TabCloseButton {}
|
||||||
|
|
||||||
let modified_color = ColorU::from_u32(0x556de8ff);
|
let modified_color = ColorU::from_u32(0x556de8ff);
|
||||||
|
let mut clicked_color = modified_color;
|
||||||
|
clicked_color.a = 180;
|
||||||
|
|
||||||
let icon = if tab_hovered {
|
let icon = if tab_hovered {
|
||||||
let mut icon = Svg::new("icons/x.svg");
|
let mut icon = Svg::new("icons/x.svg");
|
||||||
|
|
||||||
MouseEventHandler::new::<TabCloseButton, _>(item_id, ctx, |mouse_state| {
|
MouseEventHandler::new::<TabCloseButton, _>(item_id, ctx, |mouse_state| {
|
||||||
if mouse_state.hovered {
|
if mouse_state.hovered {
|
||||||
Container::new(icon.with_color(ColorU::white()).boxed())
|
Container::new(icon.with_color(ColorU::white()).boxed())
|
||||||
.with_background_color(modified_color)
|
.with_background_color(if mouse_state.clicked {
|
||||||
|
clicked_color
|
||||||
|
} else {
|
||||||
|
modified_color
|
||||||
|
})
|
||||||
.with_corner_radius(close_icon_size / 2.)
|
.with_corner_radius(close_icon_size / 2.)
|
||||||
.boxed()
|
.boxed()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue