Merge pull request #222 from zed-industries/fix-hover-beachball

Give the MouseEventHandlers for each tab bar their own id
This commit is contained in:
Max Brunsfeld 2021-11-03 19:38:04 -07:00 committed by GitHub
commit 61b9179fb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -2418,6 +2418,10 @@ impl<'a, T: View> RenderContext<'a, T> {
pub fn handle(&self) -> WeakViewHandle<T> {
WeakViewHandle::new(self.window_id, self.view_id)
}
pub fn view_id(&self) -> usize {
self.view_id
}
}
impl AsRef<AppContext> for &AppContext {

View file

@ -182,7 +182,7 @@ impl Pane {
let theme = &settings.theme;
enum Tabs {}
let tabs = MouseEventHandler::new::<Tabs, _, _, _>(0, cx, |mouse_state, cx| {
let tabs = MouseEventHandler::new::<Tabs, _, _, _>(cx.view_id(), cx, |mouse_state, cx| {
let mut row = Flex::row();
for (ix, item) in self.items.iter().enumerate() {
let is_active = ix == self.active_item;