def resize_children(self): Box.resize_children(self) pos = self.tab_position horizontal = pos.startswith("right") or pos.startswith("left") if horizontal: self.tabbox.alloc_w, self.tabbox.alloc_h = self.tabbox.alloc_h, self.tabbox.alloc_w if pos.startswith("right"): self.tabbox.x += self.tabbox.height elif pos.startswith("left"): self.tabbox.y += self.tabbox.width # show/hide thes croll buttons # doing it here to avoid recursion as changing visibility calls parent resize self.tabs_back.visible = self.tabs_forward.visible = self.show_scroll in ( True, "auto_invisible") self.tabbox.resize_children() self.tabs_container.resize_children() if self.show_scroll == "auto_invisible": self.tabs_back.visible = self.tabs_forward.visible = True if self.tabs_container.width < self._tabs_viewport.width: self.tabs_back.opacity = self.tabs_forward.opacity = 0 else: self.tabs_back.opacity = self.tabs_forward.opacity = 1 else: self.tabs_back.opacity = self.tabs_forward.opacity = 1 self.tabs_back.visible = self.tabs_forward.visible = self.show_scroll is True or \ (self.show_scroll == "auto" and \ self.tabs_container.width > self._tabs_viewport.width) self.tabbox.resize_children() self._position_tabs()
def resize_children(self): Box.resize_children(self) pos = self.tab_position horizontal = pos.startswith("right") or pos.startswith("left") if horizontal: self.tabbox.alloc_w, self.tabbox.alloc_h = self.tabbox.alloc_h, self.tabbox.alloc_w if pos.startswith("right"): self.tabbox.x += self.tabbox.height elif pos.startswith("left"): self.tabbox.y += self.tabbox.width # show/hide thes croll buttons # doing it here to avoid recursion as changing visibility calls parent resize self.tabs_back.visible = self.tabs_forward.visible = self.show_scroll in (True, "auto_invisible") self.tabbox.resize_children() self.tabs_container.resize_children() if self.show_scroll == "auto_invisible": self.tabs_back.visible = self.tabs_forward.visible = True if self.tabs_container.width < self._tabs_viewport.width: self.tabs_back.opacity = self.tabs_forward.opacity = 0 else: self.tabs_back.opacity = self.tabs_forward.opacity = 1 else: self.tabs_back.opacity = self.tabs_forward.opacity = 1 self.tabs_back.visible = self.tabs_forward.visible = self.show_scroll is True or \ (self.show_scroll == "auto" and \ self.tabs_container.width > self._tabs_viewport.width) self.tabbox.resize_children() self._position_tabs()
def resize_children(self): Box.resize_children(self) self._size_slider()