Bug 579536

Summary: [StyledText] Cannot set margin color in dark theme
Product: [Eclipse Project] Platform Reporter: Jarvis Yu <jarvis_jiaqi>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: rolf.theunissen
Version: 4.24   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
in light theme
none
in dark theme none

Description Jarvis Yu CLA 2022-04-01 01:39:53 EDT
Why can not set some controls background in drak theme?
Comment 1 Rolf Theunissen CLA 2022-04-01 05:32:35 EDT
Can you be more specific? What is exactly not working? Maybe add a screenshot of the problem?
Comment 2 Jarvis Yu CLA 2022-04-01 06:08:49 EDT
Created attachment 288360 [details]
in light theme
Comment 3 Jarvis Yu CLA 2022-04-01 06:09:55 EDT
Created attachment 288361 [details]
in dark theme
Comment 4 Jarvis Yu CLA 2022-04-01 06:11:19 EDT
(In reply to Rolf Theunissen from comment #1)
> Can you be more specific? What is exactly not working? Maybe add a
> screenshot of the problem?

The same code : 

Shell shell = new Shell( SWT.DIALOG_TRIM | SWT.RESIZE ) ;
shell.setLayout( new FillLayout() ) ;
shell.setSize( 500, 500 ) ;

Composite composite = new Composite( shell, SWT.NONE ) ;
composite.setLayout( new FillLayout() ) ;

StyledText styledText = new StyledText( composite, SWT.NONE ) ;
styledText.setText( "ABC 123 ABC 123 ABC 123 ABC 123" ) ;
styledText.setMargins( 50, 50, 50, 50 ) ;
styledText.setMarginColor( new Color( 255, 0, 0 ) ) ;

shell.open() ;
Comment 5 Jarvis Yu CLA 2022-04-01 07:43:52 EDT
(In reply to Rolf Theunissen from comment #1)
> Can you be more specific? What is exactly not working? Maybe add a
> screenshot of the problem?

If I don't use Composite here, it works.

Code : 

        Shell shell = new Shell( SWT.DIALOG_TRIM | SWT.RESIZE ) ;
        shell.setLayout( new FillLayout() ) ;
        shell.setSize( 500, 500 ) ;
        
//        Composite composite = new Composite( shell, SWT.NONE ) ;
//        composite.setLayout( new FillLayout() ) ;
        
        StyledText styledText = new StyledText( shell, SWT.NONE ) ;
        styledText.setText( "ABC 123 ABC 123 ABC 123 ABC 123" ) ;
        styledText.setMargins( 50, 50, 50, 50 ) ;
        styledText.setMarginColor( new Color( 255, 0, 0 ) ) ;
        
        shell.open() ;