-
Notifications
You must be signed in to change notification settings - Fork 14
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
implement file truncating #203
Conversation
…ng displayed over two lines
Could probably be a bit simplified by extracting the |
Thanks for implementing! Could you create an option in |
I've tested it now too. Works really well so far. Here are a few more points:
|
I observed some jumping when putting the offset at 10, so I put it at 15. The full label is now shown when hovered, but only if it is truncated, not if the full label is already shown |
Used only the |
Hi, I made the following changes to the code:
Do you agree and could you review my changes? Thanks! |
thanks for the improvements with the letter sizes! I don't like truncating at the end though, mainly because now files like all look identical - which is probably the reason why macOS (and maybe other OS/explorers) split it in the middle or at like 2/3 of the name. But I personally also find the display of |
mh yeah ok that's true. Then I'll try to truncate the name in the middle. |
Windows actually truncates right at the end, even without including the file extension. I've now gotten the truncating in the middle to work with the char sizes, but I'm currently debating whether that justifies the performance. In terms of performance, it's much more resource heavy. |
Pushed the changes. Let me know what you think |
Oh, okay, did not know that about windows. Hmm, how much more resources are we talking about? I don't notice a considerable difference between the two. I noticed a bug: if a directory has a dot in it (like a date) it is now interpreted as the extension, thus giving: |
We could also add it as an option if one wants to split in the middle or at the end. |
We have to clone strings several times and iterate the file_stem several times, which we don't need with back truncating. In reality you won't notice much of a difference, but at the latest in large directories when all elements are updated (e.g. when you enter something in the search) it can make a difference in performance.
Ahh lol. Don't think it's because of the |
shouldn't egui only update the visible items in a But yeah, could still make sense to make it optional - especially if it is different across operating systems and people might favor one over the other out of habit |
Only if you use |
Ah, yes, I see. Thanks for the clarification! |
FYI: #181 |
I fixed the problem with directories containing dots. The problem was both |
I wouldn't add an option for truncating in the middle or back btw. This is actually something that the user of the file dialog should decide and not the backend app. But user settings is something much bigger that we can implement at some point in the future. |
yeah that makes sense.
Yes, I thought so too. Now it works perfectly, I like it! |
Great, thanks for testing! Will merge the PR tomorrow when I've tested on Linux. |
Cool, thanks! I created an issue about the |
implement file truncating in the middle to prevent filenames from bei…ng displayed over two lines.
Addresses an issue stated in #200