use the right click event for buttons

This commit is contained in:
Conrad Irwin 2023-11-28 21:14:17 -07:00
parent e36c7dd301
commit 0d4839b973
5 changed files with 19 additions and 28 deletions

View file

@ -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(),