def __init__(self, **kwargs): super(MTTabs, self).__init__(**kwargs) self.topbar = MTBoxLayout(orientation='horizontal') self.layout = MTBoxLayout(orientation='vertical', invert_y=True) self.layout.add_widget(self.topbar) super(MTTabs, self).add_widget(self.layout) self.current = None self.tabs = dict() self.layout.push_handlers(on_resize=self.on_layout_resize)
def __init__(self, **kwargs): kwargs.setdefault('show_tabs', False) kwargs.setdefault('duration', 1.) super(MTScreenLayout, self).__init__(**kwargs) self.screens = SafeList() self.screen = None self.previous_screen = None self._switch_t = 1.1 self.duration = kwargs.get('duration') self.container = MTBoxLayout(orientation='vertical') super(MTScreenLayout, self).add_widget(self.container) self.tabs = self.new_tab_layout() self._show_tabs = False self.show_tabs = kwargs.get('show_tabs', False)
def new_tab_layout(self): '''called in init, to create teh layout in which all teh tabs are put. overwrite to create custom tab layout (default is box layout, vertical, height=50, with horizontal stretch.)''' return MTBoxLayout(size_hint=(1.0, None), height=50)