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

Text Edit: Add a property to handle scrolling automatically #4290

Open
hunger opened this issue Jan 8, 2024 · 6 comments
Open

Text Edit: Add a property to handle scrolling automatically #4290

hunger opened this issue Jan 8, 2024 · 6 comments
Labels
a:text Text rendering, fonts, Text input (mS,bF) enhancement New feature or request priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this

Comments

@hunger
Copy link
Member

hunger commented Jan 8, 2024

This was added to #474:

hello, I advice that it is necessary to add an attribute to determine whether the scroll bar automatically scrolls the latest content when the content exceeds the current display area.

I extracted that so it does become more visible.

@hunger hunger added a:text Text rendering, fonts, Text input (mS,bF) a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) labels Jan 8, 2024
@ogoffart ogoffart added the enhancement New feature or request label Jan 8, 2024
@ogoffart
Copy link
Member

ogoffart commented Jan 8, 2024

Is that really something we want as a property?
Maybe something like scroll-to-end() or some function like that.
It is currently even possible by using the foo.set-selection-offsets(foo.text.length, foo.text.length) (only that .length is not implemented in Slint, but you can get it with a native callback)

@hunger
Copy link
Member Author

hunger commented Jan 8, 2024

I wanted to capture the issue and it was going to get lost as a comment to some old issue:-)

I am not sure it warrants a property, maybe we should just add it as a recipe instead.

@ogoffart ogoffart added priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this and removed a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) labels Jan 9, 2024
@felipefdl
Copy link

I'm working on creating a log viewer and am facing some difficulties. Every new line is added at the bottom of the scrollview, but I can't seem to find a way to control the scrolling or focus on the last item. Any suggestions would be greatly appreciated.

@tronical
Copy link
Member

tronical commented Feb 6, 2024

The behaviour I suggest we implement is that if the cursor as at the end of the TextEdit and text is appended, the cursor should remain visible - which implies scrolling. I think fixing this does not require adding new API - for the very common case. (IF the TextEdit is read-only then there's still a cursor, so the logic can remain the same).

@lokkju
Copy link

lokkju commented Apr 20, 2024

I'm working on creating a log viewer and am facing some difficulties. Every new line is added at the bottom of the scrollview, but I can't seem to find a way to control the scrolling or focus on the last item. Any suggestions would be greatly appreciated.

@felipefdl - did you make any progress on this? I'm looking to do essentially the same thing: display text in a scrolling view, as it is added.

@felipefdl
Copy link

I'm working on creating a log viewer and am facing some difficulties. Every new line is added at the bottom of the scrollview, but I can't seem to find a way to control the scrolling or focus on the last item. Any suggestions would be greatly appreciated.

@felipefdl - did you make any progress on this? I'm looking to do essentially the same thing: display text in a scrolling view, as it is added.

No, I migrated my app to tauri for that :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:text Text rendering, fonts, Text input (mS,bF) enhancement New feature or request priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this
Projects
None yet
Development

No branches or pull requests

5 participants