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

Rework AcceptDialog's ok button text #81178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Aug 30, 2023

AcceptDialog's ok_button_text was directly operating on the button's text. This might be ok if the text does not change, but it does change. FileDialog was overriding it, making it not editable and causing a translated text to be saved in the scene file.

This PR reworks how the text is used. It's split into 2 properties: one is the user-defined ok text, the other, internal, property is the default ok text. When the user's ok text is empty, the internal text will be used. FileDialog uses now internal text.

godot.windows.editor.dev.x86_64_FpzxQRkYEv.mp4

Fixes #79803
Fixes #62827 (comment)
Supersedes #79848

This slightly breaks compatibility. Dialogs that previously had ok text defined will not be able to override it internally (affects only FileDialog). Also you can't set empty button text; at best you can put a space.

@KoBeWi KoBeWi added this to the 4.2 milestone Aug 30, 2023
@KoBeWi KoBeWi requested review from a team as code owners August 30, 2023 19:24
@AThousandShips AThousandShips modified the milestones: 4.2, 4.3 Oct 26, 2023
@akien-mga akien-mga modified the milestones: 4.3, 4.x Jun 26, 2024
@thatsmaik
Copy link

I just stumbled across this issue on my project myself. Took me a while to understand that something internally doesn't seem to work properly. Please review this and push it into the main branch if possible - right now this FileDialog property causes confusion and should work as described by KoBeWi.

The use case for me to change the OK button text with the Open File mode was to load a custom project save file and i would like to rename the OPEN button to LOAD to underscore what is going on. The window title does the job, sure, but they work best in tandem in my opinion.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally, it works as expected. Code looks good to me.

Given the compatibility breakage, it would be best to merge this early in the 4.5 cycle so it's in 4.5.dev1.

@KoBeWi KoBeWi modified the milestones: 4.x, 4.5 Jan 21, 2025
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.

FileDialog confirmation button text can't be changed when in folder mode.
5 participants