Style the active entry in the project panel
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
ad92bfe79f
commit
6007fa6ab3
@@ -469,12 +469,11 @@ impl ProjectPanel {
|
||||
(entry.worktree_id, entry.entry_id),
|
||||
cx,
|
||||
|state, _| {
|
||||
let style = if details.is_selected {
|
||||
&theme.selected_entry
|
||||
} else if state.hovered {
|
||||
&theme.hovered_entry
|
||||
} else {
|
||||
&theme.entry
|
||||
let style = match (details.is_selected, state.hovered) {
|
||||
(false, false) => &theme.entry,
|
||||
(false, true) => &theme.hovered_entry,
|
||||
(true, false) => &theme.selected_entry,
|
||||
(true, true) => &theme.hovered_selected_entry,
|
||||
};
|
||||
Flex::row()
|
||||
.with_child(
|
||||
|
||||
@@ -116,6 +116,7 @@ pub struct ProjectPanel {
|
||||
pub entry: ProjectPanelEntry,
|
||||
pub hovered_entry: ProjectPanelEntry,
|
||||
pub selected_entry: ProjectPanelEntry,
|
||||
pub hovered_selected_entry: ProjectPanelEntry,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user