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

Rewrite the algorithm that sets smallIcon/largeIcon in Decorations class #1879

Merged

Conversation

fedejeanne
Copy link
Contributor

@fedejeanne fedejeanne commented Mar 6, 2025

The output is the same but the new algorithm doesn't sort and select the 1st one, it directly searches for the best one.

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Test Results

   509 files  ±0     509 suites  ±0   10m 20s ⏱️ ±0s
 4 308 tests ±0   4 296 ✅ +1   11 💤 ±0  1 ❌  - 1 
16 576 runs  ±0  16 467 ✅ +1  108 💤 ±0  1 ❌  - 1 

For more details on these failures, see this check.

Results for commit 0892529. ± Comparison against base commit 7f381e8.

♻️ This comment has been updated with latest results.

@fedejeanne fedejeanne force-pushed the fix_blurry_shell_icon branch from 172580b to 2089d41 Compare March 6, 2025 15:23
@fedejeanne fedejeanne marked this pull request as ready for review March 10, 2025 09:22
@fedejeanne
Copy link
Contributor Author

Failing test is unrelated: #1843

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplifying this functionality and improve comprehensibility is a good thing.
I left some proposal for improving the code and making the logic comprehensible. Most essential for me would be to assign the compares values that are hard to understand (system metrics, image data at specific zooms) to comprehensive, self-explaining variables, as that's exactly the part that confused me all the time and made it difficult to understand what happens here.

Apart from that, formatting does currently seems to be broken at several places (in particular, missing whitespaces).

@fedejeanne fedejeanne force-pushed the fix_blurry_shell_icon branch 3 times, most recently from b4659b3 to 74f094a Compare March 12, 2025 10:24
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely much cleaner and easier to understand now 👍
Once formatting is correct, I think this is good to go.

Don't sort, compare and keep the image that is closest to the desired
dimensions, pixel transparency and pixel depth.

The new method "isCloserThan" is based on the (now deleted) "compare"
method and returns true only if "compare" would have returned -1

Reduce visibility of Decorations::setImages
@fedejeanne fedejeanne force-pushed the fix_blurry_shell_icon branch from 99093d5 to 0892529 Compare March 12, 2025 15:10
@fedejeanne
Copy link
Contributor Author

Perfect! 0892529 only changes the formatting of the affected code. I used Ctrl + Shift + F.

@fedejeanne
Copy link
Contributor Author

Test failure is unrelated (test timeout) since the last change only changed formatting. Merging.

@fedejeanne fedejeanne merged commit e1f11c9 into eclipse-platform:master Mar 12, 2025
12 of 14 checks passed
@fedejeanne fedejeanne deleted the fix_blurry_shell_icon branch March 12, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell icon is blurry
2 participants