use crate::DevToolsState;
#[derive(Clone, Debug, PartialEq)]
pub struct DevToolsWebPanel {
shortcut: String,
}
impl DevToolsWebPanel {
pub fn new() -> Self {
Self {
shortcut: "`".to_owned(),
}
}
pub fn with_shortcut(shortcut: impl Into<String>) -> Self {
Self {
shortcut: shortcut.into(),
}
}
pub fn shortcut(&self) -> &str {
&self.shortcut
}
pub fn toggle(&self, state: &mut DevToolsState) {
state.toggle();
}
pub fn render_summary(&self, state: &DevToolsState) -> String {
format!(
"Animato DevTools [{}] open={}",
self.shortcut,
state.is_open()
)
}
}
impl Default for DevToolsWebPanel {
fn default() -> Self {
Self::new()
}
}