Skip to content

Commit

Permalink
Ticket#39: Adapt GetSystemMetrics call to be DPI dependent
Browse files Browse the repository at this point in the history
Writing GetSystemMetrics method in Widget class so that the child
controls can use it to get System Metrics to be DPI dependent

vi-eclipse/Eclipse-Platform#39
  • Loading branch information
ShahzaibIbrahim committed May 2, 2024
1 parent 04f724a commit 3384021
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2650,4 +2650,14 @@ void setZoom(int zoom) {
private static void handleDPIChange(Widget widget, int newZoom, float scalingFactor) {
widget.setZoom(newZoom);
}

int getSystemMetrics(int nIndex) {
if (OS.WIN32_BUILD >= OS.WIN32_BUILD_WIN10_1607) {
return OS.GetSystemMetricsForDpi(nIndex, DPIUtil.mapZoomToDPI(getZoom()));
} else {
return OS.GetSystemMetrics(nIndex);
}
}


}

0 comments on commit 3384021

Please sign in to comment.