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

Scripting: add addRadioButtonGroup to Dialog #4107

Merged
merged 12 commits into from
Nov 29, 2024

Conversation

dogboydog
Copy link
Contributor

@dogboydog dogboydog commented Nov 28, 2024

Fix #3478

TODO @dogboydog

  • Update scripting API doc
  • Update News.md
  • Fix radio buttons being invisible
  • Provide example of responding to selected option changes
  • Provide a way to select one of the radio buttons from the script?
  • Decide on tooltip API

Examples: https://github.com/dogboydog/tiled-dialog-scripts Radio*.mjs

radio.button.tooltips.mov

@dogboydog
Copy link
Contributor Author

Currently I'm trying a few different things to try to get the radio buttons to show up. They seem to be invisible. Tried putting them in a QHBoxLayout and that didn't seem to help . Trying to do something like the example here
https://doc.qt.io/qt-6.5/qgroupbox.html#flat-prop

image

@dogboydog
Copy link
Contributor Author

dogboydog commented Nov 28, 2024

Also planning on looking at #4014 in the future, and thinking I should start providing the tooltip optional argument on this widget. Only thing is in this case (and with the combo box) the tooltip would be for the whole button group, which might be less useful than per radio button. I guess you could embed a description of all the options in your tooltip though.

Edit: Just added. Example:
image

@eishiya
Copy link
Contributor

eishiya commented Nov 28, 2024

Would it be possible to have the tooltip method accept an array of tooltips, one for each radio button?

…oup.addItem(value, tooltip?) method for adding a single radio button
@dogboydog dogboydog marked this pull request as ready for review November 28, 2024 17:45
@dogboydog
Copy link
Contributor Author

Examples

radio.button.tabs.mov
radio.button.tooltips.mov

@dogboydog dogboydog changed the title [draft] Scripting: add addRadioButtonGroup to Dialog Scripting: add addRadioButtonGroup to Dialog Nov 28, 2024
src/tiled/scriptdialog.cpp Outdated Show resolved Hide resolved
docs/scripting-doc/index.d.ts Outdated Show resolved Hide resolved
src/tiled/scriptdialog.cpp Outdated Show resolved Hide resolved
@bjorn bjorn merged commit 44fc91b into mapeditor:master Nov 29, 2024
6 of 7 checks passed
@dogboydog dogboydog deleted the 3478-dialog-radio branch November 29, 2024 21:16
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

Successfully merging this pull request may close these issues.

Scripting: Dialog radio buttons
3 participants