Mercurial > libervia-desktop-kivy
comparison cagou/core/widgets_handler.py @ 263:fe540a6dc14d
widgets handler: call host._removeVisibleWidget when a widget is deleted (using split)
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 11 Mar 2019 08:39:43 +0100 |
parents | 145c29b5f2b5 |
children | a5dfc789eeaf |
comparison
equal
deleted
inserted
replaced
262:825e8c91b703 | 263:fe540a6dc14d |
---|---|
66 return "WHWrapper_{idx}".format(idx=self._wid_idx) | 66 return "WHWrapper_{idx}".format(idx=self._wid_idx) |
67 | 67 |
68 def _main_wid(self, wid_list): | 68 def _main_wid(self, wid_list): |
69 """return main widget of a side list | 69 """return main widget of a side list |
70 | 70 |
71 main widget is either the widget currently splitter | 71 main widget is either the widget currently splitted |
72 or any widget if none is split | 72 or any widget if none is split |
73 @return (WHWrapper, None): main widget or None | 73 @return (WHWrapper, None): main widget or None |
74 if there is not widget | 74 if there is not widget |
75 """ | 75 """ |
76 if not wid_list: | 76 if not wid_list: |
267 if self._split == 'top': | 267 if self._split == 'top': |
268 # we remove all top widgets in delete zone, | 268 # we remove all top widgets in delete zone, |
269 # and update there side widgets list | 269 # and update there side widgets list |
270 for top in self._top_wids.copy(): | 270 for top in self._top_wids.copy(): |
271 if top.height <= REMOVE_WID_LIMIT: | 271 if top.height <= REMOVE_WID_LIMIT: |
272 G.host._removeVisibleWidget(top.current_slide) | |
272 for w in top._top_wids: | 273 for w in top._top_wids: |
273 w._bottom_wids.remove(top) | 274 w._bottom_wids.remove(top) |
274 w._bottom_wids.update(top._bottom_wids) | 275 w._bottom_wids.update(top._bottom_wids) |
275 for w in top._bottom_wids: | 276 for w in top._bottom_wids: |
276 w._top_wids.remove(top) | 277 w._top_wids.remove(top) |
283 elif self._split == 'left': | 284 elif self._split == 'left': |
284 # we remove all left widgets in delete zone, | 285 # we remove all left widgets in delete zone, |
285 # and update there side widgets list | 286 # and update there side widgets list |
286 for left in self._left_wids.copy(): | 287 for left in self._left_wids.copy(): |
287 if left.width <= REMOVE_WID_LIMIT: | 288 if left.width <= REMOVE_WID_LIMIT: |
289 G.host._removeVisibleWidget(left.current_slide) | |
288 for w in left._left_wids: | 290 for w in left._left_wids: |
289 w._right_wids.remove(left) | 291 w._right_wids.remove(left) |
290 w._right_wids.update(left._right_wids) | 292 w._right_wids.update(left._right_wids) |
291 for w in left._right_wids: | 293 for w in left._right_wids: |
292 w._left_wids.remove(left) | 294 w._left_wids.remove(left) |