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

Support IDE zoom and presentation mode #234

Merged
merged 4 commits into from
Nov 1, 2023
Merged

Conversation

devkanro
Copy link
Collaborator

@devkanro devkanro commented Nov 1, 2023

截屏2023-11-01 10 34 02

@devkanro devkanro added this to the Milestone 9 — v0.9.0 milestone Nov 1, 2023
@devkanro devkanro linked an issue Nov 1, 2023 that may be closed by this pull request
@devkanro devkanro requested review from rock3r and Walingar and removed request for Walingar November 1, 2023 02:41
Copy link
Collaborator

@rock3r rock3r left a comment

Choose a reason for hiding this comment

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

Great job! Only one question

@rock3r rock3r enabled auto-merge (squash) November 1, 2023 10:52
@rock3r rock3r merged commit 2b21c85 into JetBrains:main Nov 1, 2023
6 checks passed
@rock3r rock3r added bridge Something that impacts the Swing LaF bridge bug Something isn't working consistency Our UI presentation is not consistent with IJ labels Nov 1, 2023

internal fun retrieveDensity(): Density {
val ideaScale = UISettingsUtils.getInstance().currentIdeScale
val scale = GraphicsEnvironment.getLocalGraphicsEnvironment()
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's better to use com.intellij.ui.scale.JBUIScale#pixScale here using Component provided as LocalComponent, and not to use defaultScreenDevice, since there are can be issues with different monitors

CompositionLocalProvider(LocalPainterHintsProvider provides BridgePainterHintsProvider(themeData.themeDefinition.isDark)) {
CompositionLocalProvider(
LocalPainterHintsProvider provides BridgePainterHintsProvider(themeData.themeDefinition.isDark),
LocalDensity provides themeData.density,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, in the future we need to subscribe on changes in user scale, idea scale and sysScale changes

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fwiw this already works following zoom changes; haven't checked what happens when changing screens/system scale

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also works with presentation mode

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When ide scale changed the look and feel changing event will be fired too. I'll check the system scale event tomorrow.

@rock3r
Copy link
Collaborator

rock3r commented Nov 1, 2023

@devkanro can you take on @Walingar's comments in a follow-up?

@devkanro
Copy link
Collaborator Author

devkanro commented Nov 1, 2023

OK, I'll check it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridge Something that impacts the Swing LaF bridge bug Something isn't working consistency Our UI presentation is not consistent with IJ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle IDE zoom and presentation mode
3 participants