Fix knockout icon background to match hovered entry background in project panel (#22258)
No issue attached, as this is something trivial and should have been part of my merged PR [here](https://github.com/zed-industries/zed/pull/22073). For context, in the above-mentioned PR, I removed the hover color from selected/marked entries in the Project Panel. The reasoning behind this change is already explained in that PR, but to reiterate: > This change was inspired by the behavior in VSCode, the Firefox sidebar, and Dolphin (KDE File Manager). When an item is selected, it doesn’t display a separate hover state to avoid confusing users about whether the item is selected or merely hovered over. @nilskch mentioned in the comments of the above PR that I should have also changed the background of the knockout icon, which appears on entries, to match the entry background color on hover. This PR addresses that. Before:  After:  Release Notes: - N/A
This commit is contained in:
parent
4fbb568f42
commit
306fc19739
1 changed files with 2 additions and 4 deletions
|
@ -3200,7 +3200,7 @@ impl ProjectPanel {
|
||||||
item_colors.default
|
item_colors.default
|
||||||
};
|
};
|
||||||
|
|
||||||
let bg_hover_color = if self.mouse_down {
|
let bg_hover_color = if self.mouse_down || is_marked || is_active {
|
||||||
item_colors.marked_active
|
item_colors.marked_active
|
||||||
} else {
|
} else {
|
||||||
item_colors.hover
|
item_colors.hover
|
||||||
|
@ -3224,9 +3224,7 @@ impl ProjectPanel {
|
||||||
.border_1()
|
.border_1()
|
||||||
.border_r_2()
|
.border_r_2()
|
||||||
.border_color(border_color)
|
.border_color(border_color)
|
||||||
.when(!is_marked && !is_active, |div| {
|
.hover(|style| style.bg(bg_hover_color))
|
||||||
div.hover(|style| style.bg(bg_hover_color))
|
|
||||||
})
|
|
||||||
.when(is_local, |div| {
|
.when(is_local, |div| {
|
||||||
div.on_drag_move::<ExternalPaths>(cx.listener(
|
div.on_drag_move::<ExternalPaths>(cx.listener(
|
||||||
move |this, event: &DragMoveEvent<ExternalPaths>, cx| {
|
move |this, event: &DragMoveEvent<ExternalPaths>, cx| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue