Bug 131645

Summary: Tree GridLines are in a colour different than Table
Product: [Eclipse Project] Platform Reporter: Rutger Ovidius <ovidr>
Component: SWTAssignee: Steve Northover <steve_northover>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Rutger Ovidius CLA 2006-03-13 22:26:27 EST
SWT CVS Win32

Tree.setLinesVisible(true) draws the grid lines in a colour different to that which the Table uses.

Tree uses OS.DrawEdge (hDC, rect, OS.BDR_SUNKENINNER...)

Table uses OS.LVS_EX_GRIDLINES, and the OS seems to use the colour of SWT.COLOR_WIDGET_BACKGROUND.

To see this in XP, change 
Display Properties -> Appearance -> 
Windows and buttons = Windows XP Style
Color scheme = Silver

(Blue (default), and Olive Green look fine)


 public static void main(String[] args) {
    final Display display = new Display();

    final Shell shell = new Shell(display);
    shell.setLayout(new FillLayout());
    final int columns = 5;

    final Tree tree = new Tree(shell, SWT.BORDER | SWT.VIRTUAL | SWT.FULL_SELECTION | SWT.MULTI);
    // tree.setBackground(display.getSystemColor(SWT.COLOR_WHITE));

    for (int i = 0; i < columns; i++)
      new TreeColumn(tree, SWT.LEFT).setWidth(75);

    tree.setHeaderVisible(true);
    tree.setLinesVisible(true);

    tree.setSortDirection(SWT.DOWN);
    tree.setSortColumn(tree.getColumn(0));

    final Table table = new Table(shell, SWT.VIRTUAL | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);

    for (int i = 0; i < columns; i++)
      new TableColumn(table, SWT.LEFT).setWidth(75);

    table.setLinesVisible(true);
    table.setHeaderVisible(true);

    table.setSortDirection(SWT.DOWN);
    table.setSortColumn(table.getColumn(0));

  

    shell.setSize(800, 600);
    shell.open();

    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    display.dispose();
  }
Comment 1 Rutger Ovidius CLA 2007-05-16 12:12:25 EDT
Created attachment 67435 [details]
Patch

It is visually unappealing to have Tables and Trees visible at the same time but have the grid lines be different colours.  Attached is quick patch that uses OS.Polyline with a pen in OS.COLOR_3DFACE rather than using OS.Drawedge to draw the Tree grid lines.
Comment 2 Rutger Ovidius CLA 2007-07-16 14:10:21 EDT
Ping for 3.4?
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:08:12 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.