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:
parent
35213606c4
commit
51ff32797d
2 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue