Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,19 @@ public static boolean useCairoAutoScale() {
return useCairoAutoScale;
}

public static int getZoomForMenuItemImage(int nativeDeviceZoom) {
String autoScaleValueForMenuItemImage = DPIUtil.autoScaleValue;
if(autoScaleValueForMenuItemImage.equals("quarter") || autoScaleValueForMenuItemImage.equals("exact")) {
autoScaleValueForMenuItemImage = "half";
}
return getZoomForAutoscaleProperty(nativeDeviceZoom, autoScaleValueForMenuItemImage);
}

public static int getZoomForAutoscaleProperty (int nativeDeviceZoom) {
return getZoomForAutoscaleProperty(nativeDeviceZoom, autoScaleValue);
}

private static int getZoomForAutoscaleProperty (int nativeDeviceZoom, String autoScaleValue) {
int zoom = 0;
if (autoScaleValue != null) {
if ("false".equalsIgnoreCase (autoScaleValue)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,15 @@ public void setImage (Image image) {
} else {
if (OS.IsAppThemed ()) {
if (hBitmap != 0) OS.DeleteObject (hBitmap);
info.hbmpItem = hBitmap = image != null ? Display.create32bitDIB (image, getZoom()) : 0;
int desiredSize = getSystemMetrics(72);
int zoom = (int) (((double) desiredSize / image.getBounds().height) * 100);
int currentSize = image.getImageData(zoom).height;
while(currentSize == desiredSize) {
zoom--;
currentSize = image.getImageData(zoom).height;
}
zoom++;
info.hbmpItem = hBitmap = image != null ? Display.create32bitDIB (image, zoom) : 0;
} else {
info.hbmpItem = image != null ? OS.HBMMENU_CALLBACK : 0;
}
Expand Down
Loading