comparison src/browser/sat_browser/libervia_widget.py @ 649:ccf95ec87005 frontends_multi_profiles

browser_side: fixes issue when placing a LiberviaWidget and some cells of the WidgetsPanel are empty
author souliane <souliane@mailoo.org>
date Fri, 27 Feb 2015 00:55:07 +0100
parents 6d3142b782c3
children 7e3cdc39c3e7
comparison
equal deleted inserted replaced
648:6d3142b782c3 649:ccf95ec87005
669 width = 100.0 / max(1, self._max_cols - 2) # we don't count the borders 669 width = 100.0 / max(1, self._max_cols - 2) # we don't count the borders
670 670
671 for row_idx in xrange(self.flextable.getRowCount()): 671 for row_idx in xrange(self.flextable.getRowCount()):
672 for col_idx in xrange(self.flextable.getCellCount(row_idx)): 672 for col_idx in xrange(self.flextable.getCellCount(row_idx)):
673 _widget = self.flextable.getWidget(row_idx, col_idx) 673 _widget = self.flextable.getWidget(row_idx, col_idx)
674 if not isinstance(_widget, BorderWidget): 674 if _widget and not isinstance(_widget, BorderWidget):
675 td_elt = _widget.getElement().parentNode 675 td_elt = _widget.getElement().parentNode
676 DOM.setStyleAttribute(td_elt, "width", "%.2f%%" % width) 676 DOM.setStyleAttribute(td_elt, "width", "%.2f%%" % width)
677 677
678 last_row = max(0, self.flextable.getRowCount() - 1) 678 last_row = max(0, self.flextable.getRowCount() - 1)
679 cellFormatter.setColSpan(last_row, 0, self._max_cols) 679 cellFormatter.setColSpan(last_row, 0, self._max_cols)