Community
Participate
Working Groups
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.
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...
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.
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?
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.
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?