Only invalidate parent view on click/hover if we read that state when rendering

Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Nathan Sobo
2022-10-14 18:09:15 -06:00
co-authored by Max Brunsfeld
parent 934474f87e
commit bc03592912
19 changed files with 124 additions and 55 deletions
+1 -1
View File
@@ -311,7 +311,7 @@ impl ChatPanel {
MouseEventHandler::<SignInPromptLabel>::new(0, cx, |mouse_state, _| {
Label::new(
"Sign in to use chat".to_string(),
if mouse_state.hovered {
if mouse_state.hovered() {
theme.chat_panel.hovered_sign_in_prompt.clone()
} else {
theme.chat_panel.sign_in_prompt.clone()