-
Notifications
You must be signed in to change notification settings - Fork 187
Handle Checkbox ImageList scaling in Table in win32 #2801
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7336,6 +7336,19 @@ LRESULT wmNotifyToolTip (NMTTCUSTOMDRAW nmcd, long lParam) { | |
| return null; | ||
| } | ||
|
|
||
| void destroyImageList() { | ||
| long oldStateImageList = OS.SendMessage(handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0); | ||
| long oldhImageList = OS.SendMessage(handle, OS.LVM_GETIMAGELIST, OS.LVSIL_SMALL, 0); | ||
| long hImageList = OS.ImageList_Create (1, 1, 0, 0, 0); | ||
| OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_STATE, hImageList); | ||
| OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_SMALL, hImageList); | ||
| OS.ImageList_Destroy(oldStateImageList); | ||
| OS.ImageList_Destroy(oldhImageList); | ||
| OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_STATE, 0); | ||
| OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_SMALL, 0); | ||
| OS.ImageList_Destroy(hImageList); | ||
| } | ||
|
|
||
| @Override | ||
| void handleDPIChange(Event event, float scalingFactor) { | ||
| super.handleDPIChange(event, scalingFactor); | ||
|
|
@@ -7358,6 +7371,12 @@ void handleDPIChange(Event event, float scalingFactor) { | |
| imageList = null; | ||
| } | ||
|
|
||
| if((style & SWT.CHECK) != 0 ) { | ||
| destroyImageList(); | ||
| int size = getItemHeightInPixels(); | ||
| setCheckboxImageList(size, size, false); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @amartya4256 previously |
||
| } | ||
|
|
||
| // if the item height was set at least once programmatically with CDDS_SUBITEMPREPAINT, | ||
| // the item height of the table is not managed by the OS anymore e.g. when the zoom | ||
| // on the monitor is changed, the height of the item will stay at the fixed size. | ||
|
|
@@ -7375,7 +7394,6 @@ void handleDPIChange(Event event, float scalingFactor) { | |
| // Update scrollbar width if no columns are available | ||
| setScrollWidth(scrollWidth); | ||
| } | ||
| fixCheckboxImageListColor (true); | ||
| settingItemHeight = false; | ||
| settingItemHeight = false; | ||
| } | ||
| } | ||
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.
cant we get the old image lists from the LVM_SETIMAGELIST instead of LVM_GETIMAGELIST?