This commit is contained in:
Nathan Sobo
2023-08-10 10:26:48 -06:00
parent dd6425e898
commit 0bf607cd2d
48 changed files with 319 additions and 325 deletions
+5 -5
View File
@@ -7,7 +7,7 @@ use crate::{
geometry::{rect::RectF, vector::Vector2F},
json::json,
Action, Axis, ElementStateHandle, LayoutContext, PaintContext, SceneBuilder, SizeConstraint,
Task, View, ViewContext,
Task, ViewContext,
};
use schemars::JsonSchema;
use serde::Deserialize;
@@ -21,7 +21,7 @@ use util::ResultExt;
const DEBOUNCE_TIMEOUT: Duration = Duration::from_millis(500);
pub struct Tooltip<V: View> {
pub struct Tooltip<V> {
child: AnyElement<V>,
tooltip: Option<AnyElement<V>>,
_state: ElementStateHandle<Rc<TooltipState>>,
@@ -51,8 +51,8 @@ pub struct KeystrokeStyle {
text: TextStyle,
}
impl<V: View> Tooltip<V> {
pub fn new<Tag: 'static, T: View>(
impl<V: 'static> Tooltip<V> {
pub fn new<Tag: 'static, T: 'static>(
id: usize,
text: String,
action: Option<Box<dyn Action>>,
@@ -166,7 +166,7 @@ impl<V: View> Tooltip<V> {
}
}
impl<V: View> Element<V> for Tooltip<V> {
impl<V: 'static> Element<V> for Tooltip<V> {
type LayoutState = ();
type PaintState = ();