Rework presenter and MouseRegion to use Handler hashmap rather than individual fields
This commit is contained in:
parent
92bc1a6eef
commit
8add81350e
30 changed files with 616 additions and 421 deletions
|
@ -1,7 +1,7 @@
|
|||
use crate::{ItemHandle, Pane};
|
||||
use gpui::{
|
||||
elements::*, platform::CursorStyle, Action, AnyViewHandle, AppContext, ElementBox, Entity,
|
||||
MutableAppContext, RenderContext, View, ViewContext, ViewHandle, WeakViewHandle,
|
||||
MouseButton, MutableAppContext, RenderContext, View, ViewContext, ViewHandle, WeakViewHandle,
|
||||
};
|
||||
use settings::Settings;
|
||||
|
||||
|
@ -191,7 +191,9 @@ fn nav_button<A: Action + Clone>(
|
|||
} else {
|
||||
CursorStyle::default()
|
||||
})
|
||||
.on_click(move |_, _, cx| cx.dispatch_action(action.clone()))
|
||||
.on_click(MouseButton::Left, move |_, cx| {
|
||||
cx.dispatch_action(action.clone())
|
||||
})
|
||||
.with_tooltip::<A, _>(
|
||||
0,
|
||||
action_name.to_string(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue