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

Add deselecting-item callback to StandardListView #5933

Open
Enyium opened this issue Aug 25, 2024 · 0 comments
Open

Add deselecting-item callback to StandardListView #5933

Enyium opened this issue Aug 25, 2024 · 0 comments
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request

Comments

@Enyium
Copy link
Contributor

Enyium commented Aug 25, 2024

With StandardListView's current-item-changed callback, you can currently only be informed of the new selected item after the fact.

As described in #6369, I'm saving widgets' content in my app after user actions subsided for a short duration (using a Timer). When the list item changes, I have to save immediately, for which I would call the one-shot Timer's prepone() function as described in the linked issue.

For this all to integrate as best as possible, StandardListView would need to get an additional callback deselecting-item that would be called before current-item changes, and only if the item is guaranteed to be deselected. This way, I'd call Timer's prepone() in deselecting-item, which would call Timer's triggered (if the Timer is running), which would read StandardListView's current-item to save the widgets' content for this list index.


Perhaps this should also be implemented for StandardTableView.

@ogoffart ogoffart added enhancement New feature or request a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) labels Aug 26, 2024
@Enyium Enyium changed the title StandardListView's current-item-changed should provide old index Add deselecting-item callback to StandardListView Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants