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

[DisplayServer] Add method to estimate window title bar size. #80409

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Aug 8, 2023

Adds a DisplayServer.window_get_title_size(String title, WindowID window) method to estimate window title size (size of the window control buttons and title string using system font).

Implemented on macOS and Windows.

Fixes #80310

@KoBeWi
Copy link
Member

KoBeWi commented Oct 2, 2023

This is the minimum width of the delete dialog:
image
The space between text and buttons seems slightly too big. Though it's an estimate, so probably can't be improved much I assume?

EDIT:
Custom dialog for comparison:
image
This spacing looks alright.

scene/main/window.cpp Outdated Show resolved Hide resolved
scene/main/window.h Outdated Show resolved Hide resolved
doc/classes/Window.xml Outdated Show resolved Hide resolved
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.

Can't say much about the platform-specific code, but it works correctly.

@akien-mga akien-mga modified the milestones: 4.x, 4.2 Oct 3, 2023
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Minor doc changes to make, otherwise seems good.

@akien-mga akien-mga merged commit 530e01b into godotengine:master Oct 3, 2023
@akien-mga
Copy link
Member

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.

Modal Dialogs' Auto-Size Behavior Should Include the Nonclient Area (Caption Text)
3 participants