Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Remove focus_in styling helper

Nathan Sobo4f096333793a
diff --git a/crates/gpui2/src/elements/div.rs b/crates/gpui2/src/elements/div.rs
index 3a3ad5936eb..e098e8ef1aa 100644
--- a/crates/gpui2/src/elements/div.rs
+++ b/crates/gpui2/src/elements/div.rs
@@ -437,14 +437,6 @@ pub trait FocusableComponent<V: 'static>: InteractiveComponent<V> {
self
}
- fn focus_in(mut self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self
- where
- Self: Sized,
- {
- self.interactivity().focus_in_style = f(StyleRefinement::default());
- self
- }
-
fn in_focus(mut self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self
where
Self: Sized,
@@ -730,7 +722,6 @@ pub struct Interactivity<V> {
pub group: Option<SharedString>,
pub base_style: StyleRefinement,
pub focus_style: StyleRefinement,
- pub focus_in_style: StyleRefinement,
pub in_focus_style: StyleRefinement,
pub hover_style: StyleRefinement,
pub group_hover_style: Option<GroupStyle>,
@@ -1113,10 +1104,6 @@ where
style.refine(&self.base_style);
if let Some(focus_handle) = self.tracked_focus_handle.as_ref() {
- if focus_handle.contains_focused(cx) {
- style.refine(&self.focus_in_style);
- }
-
if focus_handle.within_focused(cx) {
style.refine(&self.in_focus_style);
}
@@ -1189,7 +1176,6 @@ impl<V: 'static> Default for Interactivity<V> {
group: None,
base_style: StyleRefinement::default(),
focus_style: StyleRefinement::default(),
- focus_in_style: StyleRefinement::default(),
in_focus_style: StyleRefinement::default(),
hover_style: StyleRefinement::default(),
group_hover_style: None,
diff --git a/crates/storybook2/src/stories/focus.rs b/crates/storybook2/src/stories/focus.rs
index a8794afdb86..571882f1f29 100644
--- a/crates/storybook2/src/stories/focus.rs
+++ b/crates/storybook2/src/stories/focus.rs
@@ -57,7 +57,6 @@ impl Render for FocusStory {
.size_full()
.bg(color_1)
.focus(|style| style.bg(color_2))
- .focus_in(|style| style.bg(color_3))
.child(
div()
.track_focus(&self.child_1_focus)