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

LineEdit and TextEdit enhancements #125

Closed
issork opened this issue Oct 4, 2019 · 6 comments
Closed

LineEdit and TextEdit enhancements #125

issork opened this issue Oct 4, 2019 · 6 comments

Comments

@issork
Copy link

issork commented Oct 4, 2019

Describe the project you are working on:
This enhancement isn't really project specific, but I came across these things while working on a modelling tool for minecraft entities that consist of cuboids, which intensively uses the UI nodes.

Describe the problem or limitation you are having in your project:
There are no limitations caused by these issues, but these small things made the editor appear less "professional", as the UI seemed to be off and not very user friendly (especially because the LineEdit might only show a single character when removing text, which could get the user lost)

Describe how this feature / enhancement will help you overcome this problem or limitation:
These enhancements would make the nodes to be more appealing to the user. More details below.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
See the linked issues in the text below - they contain gifs that clearly show the issues I am having.

Describe implementation detail for your proposal (in code), if possible:

These are a few things regarding LineEdit or TextEdit that should be changed to match other applications behaviour and make them more appealing.

First of all; these two nodes are drifting apart in terms of what they should have in common.

  • clicking on a letter in LineEdit always places the caret right in front of the clicked letter. On TextEdit however if the first half of the letter was clicked, it places the caret in front of the letter and behind of the letter if the latter half was clicked.
  • the width of the caret differs between these two nodes (TextEdit has a wider caret). This can be a problem in forms that use both of these nodes. I personally prefer the width of the LineEdit caret.
  • double clicking on a LineEdit marks the whole text but keeps the caret position, TextEdit places the caret behind the marked text.
  • TextEdit focus outline is not drawn correctly godot#12810
  • removing text from a LineEdit that contains more text than can be drawn will result in it no longer presenting as much information to the user as possible. TextEdit adjusts the scroll position. This can be seen in the gif of this issue; LineEdit and TextEdit improvements when removing text godot#27420

These are just the things I remember. I just tested them again while writing this issue in an up to date build of the master branch. More can be found when browsing through open issues.

Possible solution:
The issue godotengine/godot#31739 suggests that TextEdit should be split into two classes that inherit what they have in common. We could apply the same to TextEdit and LineEdit - have them inherit their common behaviour which could prevent this from even happening. Just adjusting both of them would lead to new issues in the future.

Now let's move on to the improvements.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
While a few of these can be worked around with a few lines of script, they should not even require that. Most of them however can not be adjusted solely in GDScript.

Is there a reason why this should be core and not an add-on in the asset library?:
Yes, as this enhancement enhances the core nodes of Godot to meet behaviour that is common across other applications - for example the web browser you are currently using.

@girng
Copy link

girng commented Oct 4, 2019

Yeah, prob just low priority issues atm (they all seems like bugs to me), but I'm sure they'll get fixed eventually. Btw, I commented on one of your issues. I could never explain that issue into words. I'm happy you created it, it's appreciated

@Calinou
Copy link
Member

Calinou commented Oct 4, 2019

the width of the caret differs between these two nodes (TextEdit has a wider caret). This can be a problem in forms that use both of these nodes. I personally prefer the width of the LineEdit caret.

I explained the rationale for this in godotengine/godot#20498. I don't think there's a perfect way of doing it, as the thicker caret is preferred by many in code editors.

@issork
Copy link
Author

issork commented Oct 4, 2019

the width of the caret differs between these two nodes (TextEdit has a wider caret). This can be a problem in forms that use both of these nodes. I personally prefer the width of the LineEdit caret.

I explained the rationale for this in godotengine/godot#20498. I don't think there's a perfect way of doing it, as the thicker caret is preferred by many in code editors.

Well, in that case I'm positive that this will no longer be an issue when TextEdit and CodeEdit are seperated.

@Paulb23
Copy link
Member

Paulb23 commented Oct 7, 2019

The joining of TextEdit and LineEdit has been discussed a few times previously, to cut a long story short, they both serve entirely different use cases and are not that interchangeable. The effort required to join them and maintenance in the longer term heavily outweighs the benefits of keeping them separate.

The rest of these are bugs, that will get fixed eventualy!

@issork
Copy link
Author

issork commented Oct 8, 2019

Thanks, feel free to close this if it doesn't belong here. I will then just open new issues on the main issue tracker if they aren't present already.

@YuriSizov
Copy link
Contributor

Probably should've closed long ago per Paul's comment. Feel free to open a new proposal or a discussion if there are some features missing. Keep in mind, that text rendering and editing has been severely reworked and improved in Godot 4.0.

@YuriSizov YuriSizov closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants