Bug 577469 - Dynamic CSS Button:selected does not dynamically toggle initial selection
Summary: Dynamic CSS Button:selected does not dynamically toggle initial selection
Status: VERIFIED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.21   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-25 08:18 EST by Wiebke Timm CLA
Modified: 2022-03-29 07:14 EDT (History)
1 user (show)

See Also:


Attachments
Example project for dynamic CSS of buttons (10.23 KB, application/x-zip-compressed)
2021-11-25 08:18 EST, Wiebke Timm CLA
no flags Details

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