Allow JS expressions in number inputs by dogboydog · Pull Request #4234 · mapeditor/tiled (original) (raw)
…ript dialog and custom properties view
- Don't use regular expressions to trim prefix/suffix
- Share the SpinBox evaluate method through a template
Not really sure what difference this makes, though. It might have some visualization potential.
QSpinBox::setValue and QDoubleSpinBox::setValue cause the text to get reset to the current value, but we don't want to do this while the user is still typing. So compare values first to not call setValue needlessly.
DoubleSpinBox is always an ExpressionDoubleSpinBox.
Actually this is called a bit too much to be executing JS. It also gets called when plain number values are set on the spin box, for example during initialization.
This way the prefix/suffix does not get in the way of typing and we don't need to parse out the prefix/suffix before evaluating the text.
Also simplified the ExpressionEvaluator class a little.
- Consistent file name order in libtilededitor.qbs
- Restore initial page of Preferences to be the first tab
- Removed no longer needed include
- Shortened news file entry
bjorn mentioned this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})