Skip to content

Conversation

HeikoKlare
Copy link
Contributor

The current mechanism to adapt the size of menu item images based on Windows system metrics, primary monitor zoom at startup and the current monitor zoom ensures that menu item images always fit to the required size for that menu. Since menus and their sizes are managed by the OS, adapting the image size as currently implemented leads to the best fitting image sizes.
However, this behavior is incompatible with the assumptions one could previously make on the sizes of those images. In particular, depending on the used auto-scale mode different kinds of scaling for those images were in place.

To achieve the best solution for all cases, this change results in the following:

  • When monitor-specific scaling is enabled, menu item images are properly scaled as required for the menu. This is independent of whether any other additional legacy settings regarding auto-scaling is made, which will be overwritten by this.
  • When monitor-specific scaling is disabled, the previous behavior is restored such that images are just scaled depending on the auto-scale mode but do not take into account which size is actually needed for that menu.

Fixes #2537

How to test

The issue can be reproduced and the fix tested with the snippet given in the original issue:

It also allows to test different combinations of auto-scale properties together with menus.

…se-platform#2537

The current mechanism to adapt the size of menu item images based on
Windows system metrics, primary monitor zoom at startup and the current
monitor zoom ensures that menu item images always fit to the required
size for that menu. Since menus and their sizes are managed by the OS,
adapting the image size as currently implemented leads to the best
fitting image sizes.
However, this behavior is incompatible with the assumptions one could
previously make on the sizes of those images. In particular, depending
on the used auto-scale mode different kinds of scaling for those images
were in place.

To achieve the best solution for all cases, this change results in the
following:
- When monitor-specific scaling is enabled, menu item images are
properly scaled as required for the menu. This is independent of whether
any other additional legacy settings regarding auto-scaling is made,
which will be overwritten by this.
- When monitor-specific scaling is disabled, the previous behavior is
restored such that images are just scaled depending on the auto-scale
mode but do not take into account which size is actually needed for that
menu.

Fixes eclipse-platform#2537
@HeikoKlare
Copy link
Contributor Author

@tmssngr this is hopefully the best tradeoff for all current use cases. It should use the new, proper menu scaling when monitor-specific scaling is enabled (without any additional auto-scaling settings), and it should use the unmodified preexisting scaling behavior when monitor-specific scaling is disabled (to allow backwards compatibilities).

Copy link
Contributor

Test Results

  115 files  ±0    115 suites  ±0   12m 25s ⏱️ -3s
4 554 tests ±0  4 538 ✅ ±0  16 💤 ±0  0 ❌ ±0 
  311 runs  ±0    308 ✅ ±0   3 💤 ±0  0 ❌ ±0 

Results for commit fd727e0. ± Comparison against base commit d2de8e3.

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.

Images in MenuItems are scaled incorrectly when autoscaling is disabled [Win] Images in MenuItems are scaled incorrectly when autoscaling is disabled

1 participant