mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Add on_hover_text_at_pointer (#1179)
This commit is contained in:
@@ -383,6 +383,14 @@ impl Response {
|
||||
true
|
||||
}
|
||||
|
||||
/// Like `on_hover_text`, but show the text next to cursor.
|
||||
#[doc(alias = "tooltip")]
|
||||
pub fn on_hover_text_at_pointer(self, text: impl Into<WidgetText>) -> Self {
|
||||
self.on_hover_ui_at_pointer(|ui| {
|
||||
ui.add(crate::widgets::Label::new(text));
|
||||
})
|
||||
}
|
||||
|
||||
/// Show this text if the widget was hovered (i.e. a tooltip).
|
||||
///
|
||||
/// The text will not be visible if the widget is not enabled.
|
||||
|
||||
Reference in New Issue
Block a user