Bug 579536 - [StyledText] Cannot set margin color in dark theme
Summary: [StyledText] Cannot set margin color in dark theme
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.24   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-01 01:39 EDT by Jarvis Yu CLA
Modified: 2022-04-01 07:43 EDT (History)
1 user (show)

See Also:


Attachments
in light theme (9.79 KB, image/png)
2022-04-01 06:08 EDT, Jarvis Yu CLA
no flags Details
in dark theme (10.82 KB, image/png)
2022-04-01 06:09 EDT, Jarvis Yu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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() ;