Bug 577469

Summary: Dynamic CSS Button:selected does not dynamically toggle initial selection
Product: [Eclipse Project] Platform Reporter: Wiebke Timm <wiebke.timm>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: Lars.Vogel
Version: 4.21   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=577463
https://bugs.eclipse.org/bugs/show_bug.cgi?id=577493
Whiteboard:
Attachments:
Description Flags
Example project for dynamic CSS of buttons none

Description Wiebke Timm CLA 2021-11-25 08:18:09 EST
Created attachment 287570 [details]
Example project for dynamic CSS of buttons

When enabling dynamic CSS with the VM argument -D... , and using Button:checked in your css file, the initially selected button is not changed dynamically but keeps its selected style even if becoming unselected. (Initially unselected buttons update their style dynamically in a correct way.)

This happens for all types of buttons that support selection (RADIO, CHECK, TOGGLE).

I attached an example project that creates all types of buttons with and without images. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=577463 manifests in there as well)
Comment 1 Wiebke Timm CLA 2021-11-25 09:14:21 EST
Comment on attachment 287570 [details]
Example project for dynamic CSS of buttons

This is not the same project as the one attached to 577463 even though the zip file has the same name - sorry about that (it does not have the additional enable/disable listeners because they are not relevant for this bug entry).
Comment 2 Lars Vogel CLA 2022-03-29 07:01:25 EDT
Hi Wiebke, this works for me after adding a rule for the regular button.

For example:

Button {
	background:white;
	color:red;
}

The way the CSS engine works, is that if certain state is not defined no logic will run. Otherwise we would have to reset but styled of each widgets on every possible event and that would be very very slow.

Please try your example with a default rule for buttons and reopen if still something is missing.
Comment 3 Wiebke Timm CLA 2022-03-29 07:14:36 EDT
Yes, with the additional definition for Button, the behavior is now correct.

Could be added to the tutorial.