emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
22.04k stars 1.59k forks source link

Add ability to disable hover tooltip on truncated labels #4427

Open SUPERCILEX opened 5 months ago

SUPERCILEX commented 5 months ago

Is your feature request related to a problem? Please describe. I'm trying to show a single row of text with whitespace stripped, but then show the original text on hover. Currently, it seems like I can't disable the stripped version from having a tooltip. Also what I'd really want is just the ability to provide custom ui for the tooltip when the text gets clipped.

rustbasic commented 5 months ago

response = ui.label("test"); Receive a response in the form. Depending on the condition, check if you get the desired result with response.enable = false.

SUPERCILEX commented 5 months ago

No, the tooltip still shows up from Layout job.

emilk commented 4 months ago

Are you talking about truncated labels, i.e. labels that replace some text with ? If so, the fix should go in here:

https://github.com/emilk/egui/blob/631b2277288a25b994b2bce191cf6a35eb497160/crates/egui/src/widgets/label.rs#L222-L225

I suggest you add a setting for this in Visuals

SUPERCILEX commented 4 months ago

Yes, thank you for the code pointer!