Commit 7801e8d2 authored by Jens Georg's avatar Jens Georg

Merge branch 'bug-79-show-tooltips-v2' into 'master'

Check hover position as widget-relative not layout-relative

See merge request !15
parents 6df577e6 b24a2b43
......@@ -2025,7 +2025,14 @@ public class CheckerboardLayout : Gtk.DrawingArea {
public override bool query_tooltip(int x, int y, bool keyboard_mode, Gtk.Tooltip tooltip) {
CheckerboardItem? item = get_item_at_pixel(x, y);
return (item != null) ? item.query_tooltip(x, y, tooltip) : false;
// Note: X & Y allocations are relative to parents, so we need to query the item's tooltip
// relative to its INTERNAL coordinates, otherwise tooltips don't work
if (item != null) {
item.translate_coordinates(ref x, ref y);
return item.query_tooltip(x, y, tooltip);
} else {
return false;
}
}
private void on_colors_changed() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment