mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-25 18:44:16 +00:00
show link url as tooltip on hover
This commit is contained in:
parent
b756e3e7c6
commit
7829e51bef
@ -192,19 +192,21 @@ impl Reader {
|
|||||||
if let Some(iter) = gobject.iter_at_location(buffer_x, buffer_y) {
|
if let Some(iter) = gobject.iter_at_location(buffer_x, buffer_y) {
|
||||||
for tag in iter.tags() {
|
for tag in iter.tags() {
|
||||||
// Tag contain URI (is link)
|
// Tag contain URI (is link)
|
||||||
if let Some(_) = _links_.get(&tag) {
|
if let Some(uri) = _links_.get(&tag) {
|
||||||
// Toggle cursor
|
// Toggle cursor
|
||||||
gobject.set_cursor_from_name(Some("pointer"));
|
gobject.set_cursor_from_name(Some("pointer"));
|
||||||
|
|
||||||
// @TODO Show tooltip
|
// Show tooltip
|
||||||
|
gobject.set_tooltip_text(Some(uri.to_string().as_str()));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore default cursor
|
// Restore defaults
|
||||||
gobject.set_cursor_from_name(Some("text"));
|
gobject.set_cursor_from_name(Some("text"));
|
||||||
|
gobject.set_tooltip_text(None);
|
||||||
}
|
}
|
||||||
}); // @TODO may be expensive for CPU, add timeout?
|
}); // @TODO may be expensive for CPU, add timeout?
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user