add_display::View done
This commit is contained in:
@@ -63,7 +63,7 @@ impl Default for Params<'_> {
|
||||
}
|
||||
|
||||
pub struct ButtonClickEvent {}
|
||||
pub type ButtonClickCallback = Box<dyn FnMut(&mut CallbackDataCommon, ButtonClickEvent) -> anyhow::Result<()>>;
|
||||
pub type ButtonClickCallback = Box<dyn Fn(&mut CallbackDataCommon, ButtonClickEvent) -> anyhow::Result<()>>;
|
||||
|
||||
pub struct Colors {
|
||||
pub color: drawing::Color,
|
||||
@@ -351,7 +351,7 @@ fn register_event_mouse_release(
|
||||
state.down = false;
|
||||
|
||||
if state.hovered
|
||||
&& let Some(on_click) = &mut state.on_click
|
||||
&& let Some(on_click) = &state.on_click
|
||||
{
|
||||
anim_hover(
|
||||
rect,
|
||||
|
||||
@@ -26,13 +26,20 @@ impl Translation {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_raw_text_rc(text: Rc<str>) -> Self {
|
||||
pub const fn from_raw_text_rc(text: Rc<str>) -> Self {
|
||||
Self {
|
||||
text,
|
||||
translated: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_raw_text_string(text: String) -> Self {
|
||||
Self {
|
||||
text: text.into(),
|
||||
translated: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_raw_text(text: &str) -> Self {
|
||||
Self {
|
||||
text: Rc::from(text),
|
||||
|
||||
Reference in New Issue
Block a user