Skip to content

Commit

Permalink
ToolItem with SWT.CHECK is not well displayed when checked and with b…
Browse files Browse the repository at this point in the history
…ackground setted.

Fix : #541
  • Loading branch information
Hélios GILLES committed Jan 30, 2023
1 parent 335d4fa commit 253c70b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 253c70b

Please sign in to comment.