Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 127216 - [Patch] Table check boxes should have shade when selected
Summary: [Patch] Table check boxes should have shade when selected
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-09 22:51 EST by Florian Priester CLA
Modified: 2006-04-26 15:16 EDT (History)
1 user (show)

See Also:


Attachments
Patch (1.11 KB, patch)
2006-02-09 22:53 EST, Florian Priester CLA
no flags Details | Diff
Screenshot (1.58 KB, image/png)
2006-04-06 19:37 EDT, Florian Priester CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Priester CLA 2006-02-09 22:51:32 EST
SWT-win32, v3223

[Windows Classic Theme with manifest]

Table check boxes should have a shade when the row they are in is selected.
See attachment 34240 [details] (right).

In order for this to work, the transparency fix from bug 125255
needs to be ported to the table widget.

Test case:

---

import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class CheckTableTest {
  public static void main(String[] args) {
    Display display = new Display();
    
    Shell shell = new Shell(display);
    shell.setLayout(new FillLayout());
    
    Table tbl = new Table(shell, SWT.BORDER | SWT.CHECK | SWT.FULL_SELECTION);
    for (int idx = 0; idx < 10; idx++) {
      new TableItem(tbl, SWT.NONE).setText("Item " + idx);
    }
    
    shell.pack();
    shell.open();
    
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) display.sleep();
    }
    
    display.dispose();
  }
}
Comment 1 Florian Priester CLA 2006-02-09 22:53:31 EST
Created attachment 34477 [details]
Patch
Comment 2 Steve Northover CLA 2006-02-13 16:28:43 EST
FH, any reason we didn't fix table too?  I thought we had determined that the fix was not necessary.
Comment 3 Steve Northover CLA 2006-04-06 16:07:25 EDT
FH, was the fix necessary?
Comment 4 Felipe Heidrich CLA 2006-04-06 17:18:22 EDT
Hi Florian, I believe we should not have the shade inside the box mark. In Tree, we used to have the shade inside the mark box and we had the changed it cause it was hard to see the check mark (bug 125255).
Comment 5 Florian Priester CLA 2006-04-06 17:48:30 EDT
These are two different things. Bug 125255 was about the tree selection bar
"showing through", making the check box contents hard to see. In contrast,
this bug requests that table check boxes have their native shade. This shade
is supplied by Windows so you can better identify the check box belonging
to the current row selection. It doesn't make the check mark hard to see.
See msconfig.exe->Services for an example of how it's supposed to look.

The reason, however, that this shade is currently missing is exactly the same
as in bug 125255; incorrectly set transparency. So the patch is still needed.
I've added an if clause so it would work even for a red table background.
Comment 6 Felipe Heidrich CLA 2006-04-06 18:03:15 EDT
Yes, I understand the problem and I know the code you wrote is right.

The only thing I'm not sure is "It doesn't make the check mark hard to see." part. In Tree people complained it was hard to read, why the same behaviour in Table would be okay.

Steve, what do you thing ?

Florian's code works fine, and the clause 'if red switch to green' should be port to Tree I think.
Comment 7 Florian Priester CLA 2006-04-06 18:11:07 EDT
> The only thing I'm not sure is "It doesn't make the check mark hard to see."
> part. In Tree people complained it was hard to read, why the same behaviour
> in Table would be okay.

The colour of the check box shade is different from the selection bar colour.
(133, 146, 181) vs. (10, 36, 106), assuming the default colours are used.
Comment 8 Florian Priester CLA 2006-04-06 19:37:46 EDT
Created attachment 37953 [details]
Screenshot

Here's another screenshot to make this clearer.

1st row: Tree selection bar appearing behind check mark
         -> BAD: Hard to see (but fixed now)

2nd row: Classic Theme table check boxes
         Left: without shade, Right: with shade (expected look)
         -> Easy to see (native behaviour)

3rd row: XP Theme table check boxes
         Left: without shade, Right: with shade (already works)
Comment 9 Felipe Heidrich CLA 2006-04-18 17:28:22 EDT
fixed in HEAD > 20060418