Mercurial > libervia-web
changeset 376:ab923b870fb0
browser side: XMLUI AdvancedListContainer: rows are highlighted when there are selectable
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 25 Feb 2014 02:13:53 +0100 |
parents | 41a386a27002 |
children | 603fa314880e |
files | browser_side/xmlui.py public/libervia.css |
diffstat | 2 files changed, 11 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/browser_side/xmlui.py Mon Feb 24 22:30:01 2014 +0100 +++ b/browser_side/xmlui.py Tue Feb 25 02:13:53 2014 +0100 @@ -171,31 +171,28 @@ self._xmlui_selectable = selectable != 'no' self._xmlui_selected_row = None self.addTableListener(self) + if self._xmlui_selectable: + self.addStyleName('AdvancedListSelectable') def onCellClicked(self, grid, row, col): if not self._xmlui_selectable: return - if self._xmlui_selected_row != row: - for widget in self._xmluiGetSelectedWidgets(): - widget.removeStyleName('AdvancedListSelectableRow-selected') - self._xmlui_selected_row = row - for widget in self._xmluiGetSelectedWidgets(): - widget.addStyleName('AdvancedListSelectableRow-selected') + self._xmlui_selected_row = row try: self._xmlui_select_cb(self) except AttributeError: print "WARNING: no select callback set" + def _xmluiAppend(self, widget): self.setWidget(self.row, self.col, widget) - widget.addStyleName('AdvancedListSelectableRow') self.col += 1 def _xmluiAddRow(self, idx): self.row += 1 self.col = 0 self._xmlui_rows_idx.insert(self.row, idx) - self.resizeRows(self.row + 1) + self.resizeRows(self.row+1) def _xmluiGetSelectedWidgets(self): return [self.getWidget(self._xmlui_selected_row, col) for col in range(self.columns)]
--- a/public/libervia.css Mon Feb 24 22:30:01 2014 +0100 +++ b/public/libervia.css Tue Feb 25 02:13:53 2014 +0100 @@ -1516,10 +1516,11 @@ } /* XMLUI styles */ -.AdvancedListSelectableRow { - cursor: pointer; + +.AdvancedListSelectable tr{ + cursor: pointer; } -.AdvancedListSelectableRow-selected { - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - color: red; + +.AdvancedListSelectable tr:hover{ + background: none repeat scroll 0 0 #EE0000; }