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

SDL3: cannot set file dialog caption #11133

Open
d-musique opened this issue Oct 9, 2024 · 6 comments
Open

SDL3: cannot set file dialog caption #11133

d-musique opened this issue Oct 9, 2024 · 6 comments
Milestone

Comments

@d-musique
Copy link
Contributor

d-musique commented Oct 9, 2024

The new file dialog API does not allow the title of the dialog to be set.
This would be good to have, if only to be able to make property localized applications.
(The Linux titles are hardcoded.)

SDL 3.1.3

@slouken slouken added this to the 3.2.0 milestone Oct 9, 2024
@slouken
Copy link
Collaborator

slouken commented Oct 9, 2024

Good point. @Semphriss, can you find a way to fix this without changing the ABI? Maybe add a property-based dialog creation function?

@Semphriss
Copy link
Contributor

IIRC, there were a few options to change the appearance of file dialogs, including the title, buttons' labels, and more, but their availability varied greatly between platforms, so I initially left anything cosmetic out of the (already quite long) functions.

I can make a function like SDL_ShowFileDialogWithProperties that could support more options; is there anything else other than the title that I should add? I can try to see what different platforms support and propose what's available.

@slouken
Copy link
Collaborator

slouken commented Oct 9, 2024

IIRC, there were a few options to change the appearance of file dialogs, including the title, buttons' labels, and more, but their availability varied greatly between platforms, so I initially left anything cosmetic out of the (already quite long) functions.

That makes sense. A properties based API has more flexibility, because it can ignore anything that isn't supported on the platform.

I can try to see what different platforms support and propose what's available.

Sure, that would be great.

@d-musique
Copy link
Contributor Author

+1 for properties API

Concerning my particular use case, only the title has importance, because other labels are already localized by OS.

The portal has its title harcoded around here; for information, I already tried replacing it with an empty string, hoping the portal might provide a default localized name in its place, but the dialog just came up with an empty title.

DBus_OpenDialog("OpenFile", "Open File", callback, userdata, window, filters, nfilters, default_location, allow_many, 0);

@Semphriss
Copy link
Contributor

@slouken I would need advice for a design decision: I noticed that some functions which accept properties have their mandatory arguments separate from the properties. For file dialogs, the only really mandatory option is the callback function. Should I:

  • have the function and its userdata pointer as separate parameters?
  • have just the function as a separate parameter, and have the userdata (and the other params) in the properties?
  • have them all in the properties?

@slouken
Copy link
Collaborator

slouken commented Oct 11, 2024

Good question. Let's have the function and userdata as separate parameters.

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

No branches or pull requests

3 participants