-
Notifications
You must be signed in to change notification settings - Fork 218
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
Truncate playable widget #513
base: main
Are you sure you want to change the base?
Conversation
@SO9010 If you're bored and want to look at something new, I've been trying to figure our how to get rid of the longstanding bug where long titles and album details don't get clipped. This is as far as I got but I feel like it's really close. |
I worked it out, the original child (the title child) needed to not be in a flex child as that will then share out the space evenly. I submitted a merge request to this branch. |
Wait, false alarm! this then makes it so it cant clip, how weird! |
Darn! Well feel free to submit commits to this branch if you figure something out! |
I have had a longer look, and it seems like something with the re-implemented logic has caused the issue where it plays that item when you click save on an item. :O |
Right I think it has, that can be resolved, I know what the issue is there to fix the save play, but the truncation was what I was trying to tackle now. |
Okay, so I have been reading the documentation. The problem comes from the fact that a non-flex widget has an infinite size. We need either the text or the dots to be a flex widget. Otherwise, they share the space equally, and the dots will never disappear. It clips well when just the text is in a flex row, with no expanding and no dots. Perhaps there is a way to interrupt the drawing of the text and then append the dots to it? Or maybe we could create a controller that changes a sizedbox depending on screen size, but this causes issues when the time changes. |
Right, I thought about painting the dots and appending them to the title, which would somewhat solve the issue, because then the title and the dots would truncate as a single item. It's a possibility, but I think it's a little tricky given that we might have to render the text as a painted object. I don't really want to make the text painted. I think the other option would be to somehow wrap the text and dots in their own flex object. It's just that it's very confusing to me how non-flex and flex objects are able to be truncated. It seems like they would need the expand_width method? It's all very confusing to me... |
I had a go at wrapping both the text and the dots into a flex widget but all that happened was that the time stamp stayed in one place. |
Ugh I really want to figure this issue out. But the inclusion of that dotted marker_widget is really confusing since there's no way to maximize the title width and have the remaining width filled by the dots while also allowing the title to be truncatable. |
229253a
to
032561b
Compare
I'm hoping to solve that issue where long titles and album details are not clipped.
If you uncomment
// .with_child(playable::is_playing_marker_widget().lens(PlayRow::is_playing))
You'll see that the whole thing will break. I'm honestly not sure how we get it to where the text of the song title expands and the is_playing_marker_widget fills in the remaining space. No combination I tried of flex/flex or flex/non-flex children work.
Help!