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

Prevent label width from flickering rapidly in editor frametime panel #92231

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented May 21, 2024

Preview

Using the Inter font.

Before

frametime_before.mp4

After

simplescreenrecorder-2024-05-23_20.53.16.mp4

@Calinou Calinou added this to the 4.3 milestone May 21, 2024
@Calinou Calinou requested a review from a team as a code owner May 21, 2024 23:10
@Calinou Calinou added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label May 21, 2024
@timothyqiu
Copy link
Member

timothyqiu commented May 22, 2024

A fixed width might not work for localized version of the text.

GPU Time: 10.25 ms

// Portuguese
Tempo de GPU: 10.25 ms

// Arabic
وقت بطاقة الشاشة: 10.25 جزء ثانية

@Calinou
Copy link
Member Author

Calinou commented May 22, 2024

A fixed width might not work for localized version of the text.

Should I calculate the field's width using the Font class to determine the minimum width (assuming a frametime of 999.99 mspf)?

@passivestar
Copy link
Contributor

passivestar commented May 23, 2024

A bit off-topic but what do you think of reparenting those stats to a common container to get rid of these?

It looks broken rather than intentional because you won't find these anywhere else in the editor (Not a part of editor's design language)

image

This also improves the background display by drawing a single background
for all 3 labels. This avoids visible corners between each label.
@Calinou Calinou force-pushed the editor-frametime-panel-prevent-width-flicker branch from d40215f to 60084dc Compare May 23, 2024 18:51
@Calinou
Copy link
Member Author

Calinou commented May 23, 2024

A fixed width might not work for localized version of the text.

The current editor language is now taken into account for minimum width calculation:

Screenshot_20240523_204853

A bit off-topic but what do you think of reparenting those stats to a common container to get rid of these?

Fixed:

Screenshot_20240523_204248

@akien-mga akien-mga merged commit 4e3d77a into godotengine:master May 23, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the editor-frametime-panel-prevent-width-flicker branch May 24, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release topic:editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frame time widget won't stay still when using a custom editor font
4 participants