mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 13:24:19 +00:00
Style the active entry in the project panel
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
ad92bfe79f
commit
6007fa6ab3
3 changed files with 11 additions and 7 deletions
|
@ -179,7 +179,11 @@ background = "$state.hover"
|
|||
|
||||
[project_panel.selected_entry]
|
||||
extends = "$project_panel.entry"
|
||||
background = "#ff0000"
|
||||
text = { extends = "$text.0" }
|
||||
|
||||
[project_panel.hovered_selected_entry]
|
||||
extends = "$project_panel.hovered_entry"
|
||||
text = { extends = "$text.0" }
|
||||
|
||||
[selector]
|
||||
background = "$surface.0"
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Reference in a new issue