SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Add various input dialogs

Open Semphriss opened this issue 6 months ago • 0 comments

I haven't seem much discussion about whether those dialogs should be added to SDL; I open this PR also as a discussion as to whether or not they should be, and which ones are relevant to SDL. I presumed it would be easier to discuss with working code available.

Description

This PR adds the following input dialogs types:

  • Text/password input image
  • Progress/loading bar image
  • Color picker image
  • Date picker image

These also seem to be available, but I'm not sure if they're globally useful:

  • List selection dialogs image
  • Scale number picker image

As of opening the PR, only the Zenity implementation is supported. I chose to open this PR early to get feedback on the current API.

Should I add the two remaining dialog types? More generally, which ones are good to add in SDL?

If some would be good to add:

  • Currently all dialogs take an SDL_PropertiesID argument; should I make a simple version for each, similarly to SDL_ShowSimpleMessageBox?
  • Should I re-use the same property field macros for fields that are similar across dialogs? (such as a single SDL_PROP_DIALOG_TITLE_STRING for all dialogs)
  • For the date picker, I did not re-use the existing SDL_DateTime struct because it seems to be a complete representation of a given timestamp (including the day of the week and the UTC offset), and I wasn't sure how to handle this. I probably should move the code to SDL_DateTime, but I would need guidance on how to design the API.

I should be able to take care of the Windows implementation, but I haven't yet gotten my hands on a new macOS device; help would be welcome.

Existing Issue(s)

Fixes #12792

Semphriss avatar May 25 '25 15:05 Semphriss