# HG changeset patch # User Goffi # Date 1524997432 -7200 # Node ID f4522b7c3318e842128fc46690a06015d7167a7c # Parent 6a288d4a493ffc096c7f9a3c5b0b42d64757342b widgets handler: use widget's top and right diff -r 6a288d4a493f -r f4522b7c3318 cagou/core/widgets_handler.py --- a/cagou/core/widgets_handler.py Sat Apr 28 20:19:53 2018 +0200 +++ b/cagou/core/widgets_handler.py Sun Apr 29 12:23:52 2018 +0200 @@ -400,35 +400,31 @@ return G.host.default_wid['factory'](G.host.default_wid, None, None) def do_layout(self, *args): - x, y = self.pos - width, height = self.width, self.height - end_x, end_y = x + width, y + height for child in self.children: # XXX: left must be calculated before right and bottom before top # because they are the pos, and are used to caculate size (right and top) # left left = child._left_wid - left_end_x = x-1 if left is None else left.x + left.width + left_end_x = self.x-1 if left is None else left.right if child.x != left_end_x + 1 and child._split == "None": child.x = left_end_x + 1 # right right = child._right_wid - right_x = end_x + 1 if right is None else right.x - if child.x + child.width != right_x - 1: + right_x = self.right + 1 if right is None else right.x + if child.right != right_x - 1: child.width = right_x - child.x - 1 # bottom bottom = child._bottom_wid if bottom is None: - if child.y != y: - child.y = y + if child.y != self.y: + child.y = self.y else: - bottom_end_y = bottom.y + bottom.height - if child.y != bottom_end_y + 1: - child.y = bottom_end_y + 1 + if child.y != bottom.top + 1: + child.y = bottom.top + 1 # top top = child._top_wid - top_y = end_y+1 if top is None else top.y - if child.y + child.height != top_y - 1: + top_y = self.top+1 if top is None else top.y + if child.top != top_y - 1: if child._split == "None": child.height = top_y - child.y - 1