Skip to content

Tooltip of DragValue can be disabled.#704

Closed
n2 wants to merge 1 commit intoemilk:masterfrom
n2:master
Closed

Tooltip of DragValue can be disabled.#704
n2 wants to merge 1 commit intoemilk:masterfrom
n2:master

Conversation

@n2
Copy link
Contributor

@n2 n2 commented Sep 9, 2021

The DragValue tooltip can be annoying sometimes, it may obscure the widgets below, or degrade the user experience (#548).
Therefore, it is best to allow developers to control whether tooltips are enabled.
Closes #548.

@sourcebox
Copy link

I think a good solution would be to also have some custom text for the tooltip in addition to disable it completely. This would make internationalization much easier.

@emilk
Copy link
Owner

emilk commented Sep 9, 2021

@sourcebox localization of the text is covered by #426 and setting a custom tooltip is already possible with ui.add(DragValue::new(…)).on_hover_text(…)

@emilk
Copy link
Owner

emilk commented Sep 9, 2021

@n2 I'm not convinced that having this option per DragValue is the right approach. Isn't it more likely that users would like to disable it for the entire program, e.g. using Style?

@sourcebox
Copy link

@emilk Thanks, I had a look into the source and saw that the text was hard-coded. So I was not sure if it can be changed.

@n2
Copy link
Contributor Author

n2 commented Sep 10, 2021

@emilk Yes, frankly, I think it's better to remove the default tooltip from widgets like DragValue. Even without considering the issue of internationalization, in different scenarios, the same widget may require different tooltips. It is best to leave the tooltip to the developer, as it is so easy to implement. On the other hand, for some widgets, one should delete tooltips with care, as it is not easy to implement (ie the color_picker button) or is necessary (ie a hyperlink). Should I close this pull request and open an issue to carefully organize the tooltips?

emilk added a commit that referenced this pull request Sep 11, 2021
@emilk emilk closed this in #708 Sep 12, 2021
emilk added a commit that referenced this pull request Sep 12, 2021
…708)

* Hide DragValue tooltips unless user set Style::explanation_tooltips

Closes #548
Closes #704

* Silence drag_angle_tau tooltip too
mankinskin pushed a commit to mankinskin/egui that referenced this pull request Sep 29, 2021
…milk#708)

* Hide DragValue tooltips unless user set Style::explanation_tooltips

Closes emilk#548
Closes emilk#704

* Silence drag_angle_tau tooltip too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DragValue hover text have default not removable message

3 participants