SimonBiggs / scriptedforms

Quickly create live-update GUIs for Python packages using Markdown and simple HTML elements.
Apache License 2.0
508 stars 34 forks source link

Text field placeholders #192

Closed olivercrask closed 6 years ago

olivercrask commented 6 years ago

Ability to start up a scriptedform with text boxes pre-filled with greyed out text. Once text is entered in to the text box, the greyed out text disappears. Similar to HTML5 text placeholders.

SimonBiggs commented 6 years ago

Yup, this should be easy I think. I'll set this for next release also.

SimonBiggs commented 6 years ago

Implemented in https://github.com/SimonBiggs/scriptedforms/commit/6c5d28ca699739e1bc58c531c320efd154406067

SimonBiggs commented 6 years ago

@OxygenLithium if you could give the dev install a go and let me know your mileage: https://github.com/SimonBiggs/scriptedforms#advanced-users-only-installing-scriptedforms-from-the-github-source

Usage is:

<variable-string name="this is the title" placeholder="this is the placeholder">
  your_variable_name
</variable-string>
SimonBiggs commented 6 years ago

On a similar topic given that the 'name' parameter is actually a 'label' I am considering changing 'name' to 'label'. Of course both name and label would work for a few 0.*.0 versions with a deprecation notice printing whenever the 'name' parameter is used.

Do you have any thoughts regarding that?

olivercrask commented 6 years ago

I'll have a look at the dev version tomorrow :) I think label makes much more sense and name should be phased out as you suggested