-
Notifications
You must be signed in to change notification settings - Fork 182
Add Snippet 386: Demonstrates Cursor constructors and DPI scaling in SWT #2492
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
base: master
Are you sure you want to change the base?
Conversation
Test Results 546 files ±0 546 suites ±0 41m 39s ⏱️ + 9m 23s For more details on these failures, see this check. Results for commit 2445626. ± Comparison against base commit 508ad4a. ♻️ This comment has been updated with latest results. |
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Show resolved
Hide resolved
aaa9b2a
to
c1b8100
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general the snippet looks good and is really helpful for testing. I have few comments on potentialy flaws and OS-specifics, and some more rather nitpicky ones on code style.
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
3eb4eba
to
5e7f5e7
Compare
@HeikoKlare I have addressed all the comments, also made some UI improvements and it is now ready for review. |
5e7f5e7
to
8afd06f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the for a snippet the code is okay now. Please auto-format the code as it does currently not conform to the auto-formatting settings. I have some minor proposals for improvement, which you could also apply with the formatting.
As the snippet perfectly shows the wrong cursor size when using the (Device, ImageData, ImageData, int, int)
constructor: do we already have a ticket for analyzing/improving that?
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java
Outdated
Show resolved
Hide resolved
8afd06f
to
16521c1
Compare
I already have a ticket for that. See, vi-eclipse/Eclipse-Platform#441 |
This snippet demonstrates several ways to construct and use cursors in an SWT application, including system cursors, custom image cursors, and DPI-aware cursors using ImageDataProvider. The user interface allows interactive selection of the cursor construction method, and updates the shell’s cursor in real time based on the current choice. The snippet displays the current system zoom level (DPI) and the expected cursor size, and draws reference ticks to help visualize scaling effects. It also responds to system DPI changes, ensuring accurate display and behavior at different zoom levels. The code is structured for clarity and modularity, making it suitable for direct use with the SWT Snippet Explorer.
16521c1
to
2445626
Compare
This snippet demonstrates several ways to construct and use cursors in an SWT application, including system cursors, custom image cursors, and DPI-aware cursors using ImageDataProvider. The user interface allows interactive selection of the cursor construction method, and updates the shell’s cursor in real time based on the current choice. The snippet displays the current system zoom level (DPI) and the expected cursor size, and draws reference ticks to help visualize scaling effects. It also responds to system DPI changes, ensuring accurate display and behavior at different zoom levels. The code is structured for clarity and modularity, making it suitable for direct use with the SWT Snippet Explorer.
Preview