Community
Participate
Working Groups
In order to style items of a Tree/Table that are hovered there is a :hover style on the TreeItem/TableItem CSS rule. With the other states of the TreeItem/TableItem (like :linesvisible :even) it is complex to create and maintain style rules that match every combination of states. Clients that just want to tweak the hover styling are also confronted with this complexity. Moreover it is currently not possible to style an item so that there apprears no extra styling when hovered. I suggest to introduce sub-widgets TableItem-Overlay and TreeItem-Overlay (or similarly named) that hold all styles that are to be applied when an item is hovered over.
I agree to this proposal since the current situation is not intuitive. Instead of setting the hover effect itself to transparent, one would currently set the hovered row to transparent, effectively overwriting any themed row colors.
*** Bug 372362 has been marked as a duplicate of this bug. ***
Created attachment 213237 [details] patch for overlay implementation This patch contains the full implementation of this feature. The subwidget is called Table-RowOverlay, but i'm actually not in favor of that name. (See next post).
A preliminary note: When i talk about selection or hover, this includes the other aswell, as the technical issues are identical for both. Same goes for Table and Tree. First, let me sum up how the behavior is right now: 1) Theming knows the Widget "TableItem". In the default und buisness theme, rules for all combinations of hover, selected, linesvisible, even and unfocused. 2) If you use a theme-contribution, you have to overwrite them all to change the hover/selection colors. 3) If you define a custom theme based on the fallback-theming (xxx.default.css), that is not the case, there only hover and selected are defined (separately). 4) Usually in RAP programatically set colors overwrite theming colors. Thats also the case for Table, UNLESS selection or hover state are set. In that case the widget is hardcoded to ignore programatically set colors of the item. This means, even if all possible combinations of states are setting the background to transparent, the item-colors are still disappearing on hover/selection, even if the theming colors don't change. What the patch does: It introduces a new theming-widget called "Table-RowOverlay". It has all the states of TableItem, and most of its properties. If a property is defined on this widget (i.e. its not transparent, inherit or none - which can also be influenced by "*"), it is used in any case, overwriting the items theming and programatic color. The priority now looks like this (from high to low): * Value from "Table-RowOverlay" theming-widget. * Value from SWT-widget. * Value from "TableItem" theming-widget. Whether the programatically set colors are overwritting or not is no longer hardcoded, but depending on whether the overlay has colors defined for the currently states. Therefore, the theming completely controls which colors are used. This does actually not change anything about points 2 and 3, but i think this bug was opend before the fallback-theming existed. Note that the overlay widget gets ALL states from item, including the custom-variant. For one thing, this is a result of the technical implementation, but its also necessary for compatibility as it is/was possible (and used in our themes) to have different hover/selection effects depending on states like unfocused. The default theme in this patch has been adjusted to behave the way it was before. (I.e. all hover and selection states are theming using the overlay.) I'm not happy with the name "Table-RowOverlay", i think its confusing. I prefere "TableItem-Overlay": The overlay is rendered completely within the bounds of the item, there is one per item (think of selection), and a "row" is nothing the application developer knows, it's an implementation detail we have only because of virtual scrolling.
Note to self: I forgot to add theming-tests for the new subwidget, and i also didn't adapt the business/fancy theme.
Created attachment 213286 [details] updated patch Updated patch: - fixed a problem with unfocused theming of overlay - fixed buisness and fancy theme - updated theming tests
Comitted patch to CVS HEAD with minor changes.