I have a composite that changes color on hover:
Composite.someclass { background-color: #FFFFFF; }
Composite.someclass:hover { background-color: #f4f4f4; }
I have an instance of that composite that has a mouse listener and two children:
Composite c = new Composite(parent, SWT.NONE);
c.setData(RWT.CUSTOM_VARIANT,"someclass");
c.addMouseListener(someMouseListener);
c.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).create());
Label l1 = new Label(c, SWT.INHERIT_DEFAULT);
l1.setText("Some text");
Label l2 = new Label(c, SWT.INHERIT_DEFAULT);
l2.setText("Other text");
Now the problem is that when I hover over the composite - the color changes and the mouse listener gets a click - as expected. When I move to a label - the color switches back to the original one and the mouse listener doesn't get the click even though the label is inside the composite.
How can I make children of a composite "transparent" wrt. to hover and the mouse listener on the parent. What if I have a deeper component hierarchy in there? Do I need to implement some overlay?