Bug 536621 - [win32][Table] Custom cell style on table doesn't work anymore is some cases
Summary: [win32][Table] Custom cell style on table doesn't work anymore is some cases
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.8   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 4.8+   Edit
Assignee: Nikita Nemkin CLA
QA Contact: Niraj Modi CLA
URL:
Whiteboard:
Keywords:
: 539056 539512 539911 545295 547369 (view as bug list)
Depends on:
Blocks: 547989 563475
  Show dependency tree
 
Reported: 2018-07-03 06:34 EDT by zzzz CLA
Modified: 2020-05-27 18:11 EDT (History)
11 users (show)

See Also:


Attachments
Screenshot of SmartSynchronize with dark theme (101.86 KB, image/png)
2019-06-06 05:41 EDT, Thomas Singer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description zzzz CLA 2018-07-03 06:34:13 EDT
Using SWT 4.8, if you set the background (or foreground, etc) on table control, then setting background on a single cell, doesn't work anymore.  


Below a snippet to demostrate the problem: the expected item color should be red  instead of yellow (as the control background)

With previous 4.7 version, this code works correctly.  

The problem doesn't affects tree control.




public static void main(String[] args) {
        Display display = Display.getDefault();

        Shell s = new Shell();
        s.setBounds(0, 0, 600, 400);

        Table table = new Table(s, SWT.VIRTUAL);

        new TableColumn(table, SWT.NONE).setWidth(200);

        table.setHeaderVisible(true);

        // REMOVE THIS LINE 
        table.setBackground(new Color(display, 255, 255, 0));

        table.addListener(SWT.SetData, new Listener() {
            @Override
            public void handleEvent(Event event) {
                TableItem ti = (TableItem) event.item;
                ti.setText(0, "Hello");
                ti.setBackground(0, new Color(display, 255, 0, 0));
            }
        });

        table.setItemCount(2);

        s.setLayout(new FillLayout());
        s.layout();

        s.open();
        for( ;; ) {
            if( display.isDisposed() || s.isDisposed() )
                return;

            if( !display.readAndDispatch() )
                display.sleep();
        }
    }
Comment 1 zzzz CLA 2018-07-03 06:35:06 EDT
I'm testing on Windows 7 64 bit version
Comment 2 Andrey Loskutov CLA 2018-07-03 06:49:52 EDT
I can't reproduce on GTK3/2, but can reproduce on Windows 7.
Comment 3 Andrey Loskutov CLA 2019-03-14 16:09:00 EDT
*** Bug 539512 has been marked as a duplicate of this bug. ***
Comment 4 Nikita Nemkin CLA 2019-04-07 08:26:34 EDT
*** Bug 545295 has been marked as a duplicate of this bug. ***
Comment 5 Andrey Loskutov CLA 2019-04-07 09:05:27 EDT
Bug 516365 /  https://git.eclipse.org/r/c/100005/ seem to be related
Comment 6 Eclipse Genie CLA 2019-04-22 12:22:23 EDT
New Gerrit change created: https://git.eclipse.org/r/140945
Comment 7 Lars Vogel CLA 2019-04-23 04:49:26 EDT
*** Bug 539056 has been marked as a duplicate of this bug. ***
Comment 9 Niraj Modi CLA 2019-04-25 03:24:47 EDT
Thanks Nikita for the bug fix, resolving now.
Comment 10 Dani Megert CLA 2019-04-25 08:24:09 EDT
.
Comment 11 Niraj Modi CLA 2019-04-26 02:37:07 EDT
Verified the fix in latest IBuild: I20190425-1800

Will back-port the fix to 4.11+ shortly today.
Comment 12 Eclipse Genie CLA 2019-04-26 03:26:20 EDT
New Gerrit change created: https://git.eclipse.org/r/141198
Comment 14 Niraj Modi CLA 2019-04-26 04:53:16 EDT
(In reply to Eclipse Genie from comment #13)
> Gerrit change https://git.eclipse.org/r/141198 was merged to
> [R4_11_maintenance].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=8a8f6a77931f47ec4002010bddaf65625acad9ea

Fix back-ported to 4.11+ resolving now.
Comment 15 Niraj Modi CLA 2019-05-06 05:22:29 EDT
Reopening for back-port to 4.8+ branch.
Comment 16 Eclipse Genie CLA 2019-05-06 05:23:55 EDT
New Gerrit change created: https://git.eclipse.org/r/141650
Comment 18 Niraj Modi CLA 2019-05-06 05:55:11 EDT
(In reply to Eclipse Genie from comment #17)
> Gerrit change https://git.eclipse.org/r/141650 was merged to
> [R4_8_maintenance].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=44584a6f685cd5c793aa69e0dba2d4d5643d9a21

Fix back-ported to 4.8+ resolving now.
Comment 19 Niraj Modi CLA 2019-05-06 06:15:57 EDT
*** Bug 539911 has been marked as a duplicate of this bug. ***
Comment 20 Niraj Modi CLA 2019-05-16 04:22:00 EDT
*** Bug 547369 has been marked as a duplicate of this bug. ***
Comment 21 Thomas Singer CLA 2019-06-06 05:41:47 EDT
Created attachment 278830 [details]
Screenshot of SmartSynchronize with dark theme

The change of this ticket introduced us serious problems, so the sort column always is drawn in very light gray.
Comment 22 Thomas Singer CLA 2019-06-06 05:45:12 EDT
Note, our tables are owner-drawn (we don't set a color to TableItem directly). Unfortunately, I failed so far to create a tiny snippet to reproduce.
Comment 23 Dani Megert CLA 2019-06-06 05:48:50 EDT
(In reply to Thomas Singer from comment #22)
> Note, our tables are owner-drawn (we don't set a color to TableItem
> directly). Unfortunately, I failed so far to create a tiny snippet to
> reproduce.
Please report this in a new bug anyway and link it to this one.
Comment 24 Thomas Singer CLA 2019-06-06 06:35:52 EDT
I've found a way to reproduce. Please see bug 547989.