Bug 324721 - Items should inherit custom variants
Summary: Items should inherit custom variants
Status: ASSIGNED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-08 06:01 EDT by Tim Buschtoens CLA
Modified: 2015-12-03 02:24 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Buschtoens CLA 2010-09-08 06:01:37 EDT
Custom variants applied to a control that holds items, should also appear on the items. Should it be possible to apply a custom variant to the item directly, the custom variant of the item would overwrite the "inherited" custom variant.
Comment 1 Ralf Sternberg CLA 2010-09-09 06:30:28 EDT
It is currently not possible to let a certain Table/Tree with a custom variant look differently. This is because many aspects of the theming like background-color, hover and selection color are defined as attributes of TableItem in the CSS. Applying a custom variant to every single item of a control, just to let the control itself look differently is neither intuitive nor easily doable.

For this reason, I'd agree to inheriting custom variants to items.

An alternative would be to invent a sub-widget "Table-Row" etc. that is independent of individual TableItems...
Comment 2 Ivan Furnadjiev CLA 2010-09-09 08:50:44 EDT
I don't like the idea for "Table-Row". Table row is an internal sub-widget that means nothing to the end user (CSS producer). I think that it will be confusing why we set the selection/hover background-color on the Table-Row and not on the TableItem.
Comment 3 Tim Buschtoens CLA 2013-10-16 05:10:35 EDT
As of RAP 2.2 the Table-RowOverlay exists, but does not inherit the custom variant either (See Bug 347755). Instead it inherits the the Items custom variant from the Item it currently displays, which is technically incorrect. If we fixed Bug 347755 the Table-Row would have both the custom variant of the item and the Table (I think...). Then a Tree/Table could be styled *partially* different, but only if the overlay is used. If it is not used (to allow the items colors to stay visible if hovered/selected) the problem remains, the item would still need to inherit the custom variant.

To really fix the theming for Table/Tree, both this bug and Bug 347755 would have to be fixed. According to comment#1 Ralf would agree to this, but it would cause the items to support multiple custom variants, which was deemd complicated in Bug 372287, so I'm not sure. Perhaps Ivan could investigate if it is feasible?
Comment 4 Ivan Furnadjiev CLA 2014-07-21 08:01:34 EDT
With commit b9ec85e775d40f923f63ee07fb0e3c2170e891a6 the implementation of Widget.js#setCustomVarian has changed to respect _getSubWidgets function. All sub widgets (returned by _getSubWidgets function) will inherit widget custom variant. Currently (RAP 2.3), it's used in some widgets, but not all.
Comment 5 Jens Borrmann CLA 2015-12-03 02:24:16 EST
Could you please enumerate the widget types for which _getSubWidgets function is respected. 

We are currently trying use a TreeViewer that should look different than our normal trees do. At first glance I get the impression that in case of trees this does not work. 

Are there plans to fix the problem for the remaining widgets?