use crate::diagnostics::{DevTools, DevToolsOptions};
use ferroui_base::input::KeyGesture;
use ferroui_controls::{Application, TopLevel};
use std::rc::Rc;
pub trait DevToolsExtensions {
fn attach_dev_tools(&self);
fn attach_dev_tools_with_options(&self, options: Rc<DevToolsOptions>);
}
pub trait DevToolsTopLevelExtensions {
fn attach_dev_tools_with_gesture(&self, gesture: KeyGesture);
}
impl DevToolsExtensions for TopLevel {
fn attach_dev_tools(&self) {
DevTools::attach(self, DevToolsOptions::new());
}
fn attach_dev_tools_with_options(&self, options: Rc<DevToolsOptions>) {
DevTools::attach(self, options);
}
}
impl DevToolsTopLevelExtensions for TopLevel {
fn attach_dev_tools_with_gesture(&self, gesture: KeyGesture) {
DevTools::attach_with_gesture(self, gesture);
}
}
impl DevToolsExtensions for Application {
fn attach_dev_tools(&self) {
DevTools::attach_application(self, DevToolsOptions::new());
}
fn attach_dev_tools_with_options(&self, options: Rc<DevToolsOptions>) {
DevTools::attach_application(self, options);
}
}