Improved the visual appeal of SelectionPrompt and MultiSelectionPrompt (text wrapping) #1578
+34
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #1577
Changes
I've modified how
SelectionPrompt<T>
andMultiSelectionPrompt<T>
render the prompt. Instead of usingGrid
with only one column, I split the row into two columns, where one is the indentation, arrow, or checkbox and the second column is the text itself. This makes the wrapping look better.Before the change:
![image](https://private-user-images.githubusercontent.com/168128663/344697610-3b957de5-975c-4ea5-a2fa-802bbd52b27a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MjU2NzQsIm5iZiI6MTczODkyNTM3NCwicGF0aCI6Ii8xNjgxMjg2NjMvMzQ0Njk3NjEwLTNiOTU3ZGU1LTk3NWMtNGVhNS1hMmZhLTgwMmJiZDUyYjI3YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMDQ5MzRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02YjYzYTAxMjk0ZGM3MTMyNjE2MDdhMWNmNWIxNTkxMzM5ODA1YTYxYTcwYmU3ZDUzNTM0YTRjNTZmMWM0MTcxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.keLy1bGBNM0VsJtnlvW0MGZAkJEMhfLQ6_ifrpwC73U)
After the change:
![image](https://private-user-images.githubusercontent.com/168128663/344698263-a9a20046-6ec8-4ca5-b0c5-d61f6c05cee0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MjU2NzQsIm5iZiI6MTczODkyNTM3NCwicGF0aCI6Ii8xNjgxMjg2NjMvMzQ0Njk4MjYzLWE5YTIwMDQ2LTZlYzgtNGNhNS1iMGM1LWQ2MWY2YzA1Y2VlMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMDQ5MzRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lZjhkNGU2N2JmYjJkZTBhMmQ1MWVlZGE1ZTAyZWYxNWJlODA5MDIwMzFjNzM0ZDYzZDc1MmNhYzcyYjRjMWIzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.vy3auGIrtZoumzlWvocbg5qdDeA48CM-4iLv0oHdsQk)
Please upvote 👍 this pull request if you are interested in it.