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

ToolItem with SWT.CHECK is not well displayed when checked and with background setted. #542

Merged
merged 2 commits into from
Apr 25, 2023
Merged
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 @@ -735,7 +735,7 @@ void layoutItems () {
}
}
}

/*
* Feature in Windows. When a tool bar is not flagged TBSTYLE_LIST already (SWT.RIGHT)
* and contains both text and images, but not text + image in a single item,
Expand Down Expand Up @@ -1691,7 +1691,6 @@ LRESULT wmNotifyChild (NMHDR hdr, long wParam, long lParam) {
RECT rect = new RECT (nmcd.left, nmcd.top, nmcd.right, nmcd.bottom);
OS.SetDCBrushColor (nmcd.hdc, child.background);
OS.FillRect (nmcd.hdc, rect, OS.GetStockObject (OS.DC_BRUSH));
result |= OS.TBCDRF_NOBACKGROUND;
}
return new LRESULT (result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static void main(String[] args) {
toggle.setText("Toggle Bar Colors");
new ToolItem(bar, SWT.SEPARATOR);
new ToolItem(bar, SWT.PUSH).setText("Push Button");
new ToolItem(bar, SWT.CHECK).setText("Check Button");
new ToolItem(bar, SWT.DROP_DOWN).setText("Drop Down");

toggle.addListener(SWT.Selection, event -> {
Expand Down