use the right click event for buttons
This commit is contained in:
parent
e36c7dd301
commit
0d4839b973
5 changed files with 19 additions and 28 deletions
|
@ -1,12 +1,12 @@
|
|||
use std::rc::Rc;
|
||||
|
||||
use gpui::{div, Element, IntoElement, MouseDownEvent, ParentElement, WindowContext};
|
||||
use gpui::{div, ClickEvent, Element, IntoElement, ParentElement, WindowContext};
|
||||
|
||||
use crate::{Color, Icon, IconButton, IconSize, Toggle};
|
||||
|
||||
pub fn disclosure_control(
|
||||
toggle: Toggle,
|
||||
on_toggle: Option<Rc<dyn Fn(&MouseDownEvent, &mut WindowContext) + 'static>>,
|
||||
on_toggle: Option<Rc<dyn Fn(&ClickEvent, &mut WindowContext) + 'static>>,
|
||||
) -> impl Element {
|
||||
match (toggle.is_toggleable(), toggle.is_toggled()) {
|
||||
(false, _) => div(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue