Bug 279349 - [CSS] Control's background does not change if a gradient was previously applied
Summary: [CSS] Control's background does not change if a gradient was previously applied
Status: RESOLVED WORKSFORME
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 0.9   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Bogdan Gheorghe CLA
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-06 09:05 EDT by Remy Suen CLA
Modified: 2019-06-05 07:27 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2009-06-06 09:05:14 EDT
Press the button to change the shell's background colour, nothing will happen. What is our strategy in terms of cleaning up styles (in this case, removing the gradient listener from the control)?

------------

final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new GridLayout());

String style = "Shell { background-color: #202020 #373737 60% ";

new Button(shell, SWT.PUSH).addSelectionListener(new SelectionAdapter() {
	public void widgetSelected(SelectionEvent e) {
		String style2 = "Shell { background-color: black ";

		CSSEngine engine = new CSSSWTEngineImpl(display);

		engine.setErrorHandler(new CSSErrorHandler() {
			public void error(Exception e) {
				e.printStackTrace();
			}
		});

		try {
			engine.parseStyleSheet(new StringReader(style2));
			engine.applyStyles(shell, true);
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}
});

CSSEngine engine = new CSSSWTEngineImpl(display);

engine.setErrorHandler(new CSSErrorHandler() {
	public void error(Exception e) {
		e.printStackTrace();
	}
});

try {
	engine.parseStyleSheet(new StringReader(style));
	engine.applyStyles(shell, true);
} catch (IOException e) {
	e.printStackTrace();
	return;
}

shell.setSize(400, 300);
shell.open();

while (!shell.isDisposed()) {
	if (!display.readAndDispatch())
		display.sleep();
}
display.dispose();
Comment 1 Eclipse Genie CLA 2019-04-19 15:06:25 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.

--
The automated Eclipse Genie.
Comment 2 Lars Vogel CLA 2019-06-05 07:27:05 EDT
This is a mass change to close all e4 bugs marked with "stalebug" whiteboard.

If this bug is still valid, please reopen and remove the "stalebug" keyword.