Skip to content

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

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
Calinou:inspector-text-show-tooltip
Dec 5, 2024
Merged

Show String properties' text in a tooltip in the inspector#76231
Repiteo merged 1 commit into
godotengine:masterfrom
Calinou:inspector-text-show-tooltip

Conversation

@Calinou

@Calinou Calinou commented Apr 18, 2023

Copy link
Copy Markdown
Member

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

Yagich commented Apr 18, 2023

Copy link
Copy Markdown
Contributor

How does this work with properties that have doc comments?

@Calinou

Calinou commented Apr 18, 2023

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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.

@ghost

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

Calinou commented Oct 28, 2024

Copy link
Copy Markdown
Member Author

Rebased and tested again, it works as expected.

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

Mickeon commented Oct 28, 2024

Copy link
Copy Markdown
Member

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

Comment thread editor/editor_properties.cpp Outdated
@KoBeWi

KoBeWi commented Oct 28, 2024

Copy link
Copy Markdown
Member

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

Calinou commented Nov 2, 2024

Copy link
Copy Markdown
Member Author

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

@KoBeWi KoBeWi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Functionality-wise looks ok.

Comment thread editor/editor_properties.cpp Outdated
@Calinou
Calinou force-pushed the inspector-text-show-tooltip branch from 18239ee to 626ee20 Compare November 19, 2024 22:40
Comment thread editor/editor_properties.cpp Outdated
Comment thread editor/editor_properties.cpp Outdated
Comment thread editor/editor_properties.cpp Outdated
Comment thread editor/editor_properties.h Outdated
@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
@Repiteo

Repiteo commented Dec 5, 2024

Copy link
Copy Markdown
Contributor

Thanks!

BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
…-tooltip

Show String properties' text in a tooltip in the inspector
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
…-tooltip

Show String properties' text in a tooltip in the inspector
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.

8 participants