Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show String properties' text in a tooltip in the inspector #76231

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Apr 18, 2023

This allows previewing single-line or multipline strings that are too long too fit within the box in the inspector.

I wonder if it's possible to only show the tooltip if the text doesn't fully fit within the box. @bruvzg Is there a way we can detect this while taking the font size and advance into account (for both LineEdit and TextEdit)?

Testing project: test_inspector_text_tooltip.zip

Preview

Screenshot_20230418_234734

@Yagich
Copy link
Contributor

Yagich commented Apr 18, 2023

How does this work with properties that have doc comments?

@Calinou
Copy link
Member Author

Calinou commented Apr 18, 2023

How does this work with properties that have doc comments?

The value's tooltip is shown when hovering the value. The documentation is only shown when hovering the name, like before. (This also applies to properties of types other than String.)

@MewPurPur
Copy link
Contributor

I wonder if it's possible to only show the tooltip if the text doesn't fully fit within the box.

I don't think that's a necessary complication, all types always show their value as tooltips.

@dustdfg

This comment was marked as off-topic.

@Calinou Calinou force-pushed the inspector-text-show-tooltip branch from 42bdfbe to 45499e3 Compare October 28, 2024 17:16
@Calinou Calinou requested a review from a team as a code owner October 28, 2024 17:16
@Calinou
Copy link
Member Author

Calinou commented Oct 28, 2024

Rebased and tested again, it works as expected.

@Mickeon Mickeon modified the milestones: 4.x, 4.4 Oct 28, 2024
@Mickeon
Copy link
Contributor

Mickeon commented Oct 28, 2024

Moving this to 4.4 as it should've been a long time coming.

@KoBeWi
Copy link
Member

KoBeWi commented Oct 28, 2024

I'm not sure if simply displaying everything is a good idea
image
It needs some sort of autowrapping/scroll.

@Calinou Calinou force-pushed the inspector-text-show-tooltip branch from 45499e3 to 18239ee Compare November 2, 2024 23:41
@Calinou
Copy link
Member Author

Calinou commented Nov 2, 2024

I've trimmed the tooltip to the first 100 characters, so it should no longer get very long now.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality-wise looks ok.

@Calinou Calinou force-pushed the inspector-text-show-tooltip branch from 18239ee to 626ee20 Compare November 19, 2024 22:40
@Calinou Calinou force-pushed the inspector-text-show-tooltip branch from 626ee20 to 713d6c6 Compare December 4, 2024 00:23
This allows previewing single-line or multipline strings
that are too long too fit within the box in the inspector.
@Calinou Calinou force-pushed the inspector-text-show-tooltip branch from 713d6c6 to e4106f8 Compare December 4, 2024 00:24
@Repiteo Repiteo merged commit 09cbe05 into godotengine:master Dec 5, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 5, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants