Bug 579470 - [CSS] Request: Add support for more dynamic CSS styles and attributes for ToolItems
Summary: [CSS] Request: Add support for more dynamic CSS styles and attributes for Too...
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-03-29 07:28 EDT by Wiebke Timm CLA
Modified: 2022-03-30 10:54 EDT (History)
2 users (show)

See Also:


Attachments
Dynamic CSS example with buttons and tool items (8.99 KB, application/x-zip-compressed)
2022-03-30 06:51 EDT, 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 2022-03-29 07:28:54 EDT
For styling eclipse SWT clients with our corporate design, we need an extension of the dynamic CSS functionality for ToolItems:


Please support these states for ToolItems:

normal
selected
hover
pressed
disabled (not dynamic yet)


And these attributes:

color, 
background-color
Comment 1 Sravan Kumar Lakkimsetti CLA 2022-03-29 22:56:32 EDT
SWT has been moved to github. Please open as issue in https://github.com/eclipse-platform/eclipse.platform.swt
Comment 2 Lars Vogel CLA 2022-03-30 04:39:37 EDT
Wiebke, can you upload an example demonstrating the toolitems you want to style?
Comment 3 Wiebke Timm CLA 2022-03-30 05:15:59 EDT
Yes, will do so after lunch! Currently in sprint planning...
Comment 4 Wiebke Timm CLA 2022-03-30 06:51:10 EDT
Created attachment 288332 [details]
Dynamic CSS example with buttons and tool items

This is an extended version of the CSS Buttons example. 

The last group contains a Toolbar with the various states.


You can style the Toolbar (hover works, disabled is ignored, others do not make sense for it) - uncomment ToolBar groups in .css file to observe... But ToolItems themselves do not support any CSS styling. (The only property in the CSS spy is swt-lines-visible. Any entries in the css file are ignored.
Comment 5 Wiebke Timm CLA 2022-03-30 06:55:21 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #1)
> SWT has been moved to github. Please open as issue in
> https://github.com/eclipse-platform/eclipse.platform.swt

This is kind of a child of https://bugs.eclipse.org/bugs/show_bug.cgi?id=577493 which was created months ago in this bug tracker. So I'd like to keep them here together. Will enter issues in github in the future.
Comment 6 Lars Vogel CLA 2022-03-30 10:30:33 EDT
ToolItems can have different icons assigned to them dependings on the state:

ToolItem item = new ToolItem (bar, 0);
item.setImage (image);
item.setDisabledImage (disabledImage);
item.setHotImage (hotImage);

As color and background canot be set add the moment, maybe you can use images for the ToolItems. Lets discuss tomorrow.
Comment 7 Wiebke Timm CLA 2022-03-30 10:54:58 EDT
Other ToolItems in our client are added via fragments as DirectToolItem. Only a single (transparent) image is set in the fragment, and the hover/selected effect is applied without having hot or disabled images.