This commit is contained in:
yumoqing 2020-07-24 14:32:32 +08:00
parent 63a4bfdb93
commit f0061e1918
2 changed files with 17 additions and 16 deletions

View File

@ -67,6 +67,7 @@ from .charts.bar import Bar
from .bgcolorbehavior import BGColorBehavior
from .utils import NeedLogin, InsufficientPrivilege, HTTPError
from .login import LoginForm
from .tab import TabsPanel
if platform == 'android':
from .widgetExt.phonebutton import PhoneButton
from .widgetExt.androidwebview import AWebView

View File

@ -1,9 +1,8 @@
"""
{
"widgettype":"BLKTabbedPanel",
"widgettype":"TabsPanel",
"options":{
"tab_pos":"top_left"
},
"tabs":[
{
"text":"tab1",
@ -17,13 +16,14 @@
{
}
]
},
}
"""
from kivy.uix.tabbedpanel import TabbedPanel
from kivy.clock import Clock
from kivy.factory import Factory
from kivyblocks.blocks import Blocks
from .bgcolorbehavior import BGColorBehavior
class TabsPanel(BGColorBehavior, TabbedPanel):
def __init__(self,**options):
@ -37,7 +37,7 @@ class TabsPanel(BGColorBehavior, TabbedPanel):
def add_tab(self,text,desc):
def add(o,w):
self.add_widget(TabbedPanelItem(text=text,content=w))
blocks = Blocks()
blocks = Factory.Blocks()
blocks.bind(on_built=add)
blocks.widgetBuild(desc,ancestor=self)