Browse Source

show link url as tooltip on hover

master
yggverse 2 months ago
parent
commit
7829e51bef
  1. 8
      src/app/browser/window/tab/item/page/content/text/gemini/reader.rs

8
src/app/browser/window/tab/item/page/content/text/gemini/reader.rs

@ -192,19 +192,21 @@ impl Reader { @@ -192,19 +192,21 @@ impl Reader {
if let Some(iter) = gobject.iter_at_location(buffer_x, buffer_y) {
for tag in iter.tags() {
// Tag contain URI (is link)
if let Some(_) = _links_.get(&tag) {
if let Some(uri) = _links_.get(&tag) {
// Toggle cursor
gobject.set_cursor_from_name(Some("pointer"));
// @TODO Show tooltip
// Show tooltip
gobject.set_tooltip_text(Some(uri.to_string().as_str()));
return;
}
}
}
// Restore default cursor
// Restore defaults
gobject.set_cursor_from_name(Some("text"));
gobject.set_tooltip_text(None);
}
}); // @TODO may be expensive for CPU, add timeout?

Loading…
Cancel
Save