mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 22:30:03 -04:00
Give each tooltip area its own unique Id (#2264)
* Don't check for clicks on non-interactive areas * Give each tooltip area its own unique Id
This commit is contained in:
@@ -236,8 +236,10 @@ impl Area {
|
|||||||
let interact_id = layer_id.id.with("move");
|
let interact_id = layer_id.id.with("move");
|
||||||
let sense = if movable {
|
let sense = if movable {
|
||||||
Sense::click_and_drag()
|
Sense::click_and_drag()
|
||||||
} else {
|
} else if interactable {
|
||||||
Sense::click() // allow clicks to bring to front
|
Sense::click() // allow clicks to bring to front
|
||||||
|
} else {
|
||||||
|
Sense::hover()
|
||||||
};
|
};
|
||||||
|
|
||||||
let move_response = ctx.interact(
|
let move_response = ctx.interact(
|
||||||
|
|||||||
@@ -209,7 +209,8 @@ fn show_tooltip_at_avoid_dyn<'c, R>(
|
|||||||
|
|
||||||
let position = position.at_least(ctx.input().screen_rect().min);
|
let position = position.at_least(ctx.input().screen_rect().min);
|
||||||
|
|
||||||
let InnerResponse { inner, response } = show_tooltip_area_dyn(ctx, id, position, add_contents);
|
let InnerResponse { inner, response } =
|
||||||
|
show_tooltip_area_dyn(ctx, id.with(count), position, add_contents);
|
||||||
|
|
||||||
state.set_tooltip_size(id, count, response.rect.size());
|
state.set_tooltip_size(id, count, response.rect.size());
|
||||||
state.store(ctx);
|
state.store(ctx);
|
||||||
|
|||||||
Reference in New Issue
Block a user