From f0061e1918fa557f468dd6fe9ae3e348dd5254f1 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 24 Jul 2020 14:32:32 +0800 Subject: [PATCH] bugfix --- kivyblocks/baseWidget.py | 1 + kivyblocks/tab.py | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/kivyblocks/baseWidget.py b/kivyblocks/baseWidget.py index bb166b8..067c439 100755 --- a/kivyblocks/baseWidget.py +++ b/kivyblocks/baseWidget.py @@ -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 diff --git a/kivyblocks/tab.py b/kivyblocks/tab.py index c19c1d0..036c5cf 100644 --- a/kivyblocks/tab.py +++ b/kivyblocks/tab.py @@ -1,29 +1,29 @@ """ { - "widgettype":"BLKTabbedPanel", + "widgettype":"TabsPanel", "options":{ "tab_pos":"top_left" - }, - "tabs":[ - { - "text":"tab1", - "icon":"/img/hhhh.png", - "refresh_press":Fasle, - "content":{ - "widgettype":"urlwidegt", - "url":"reggtY", + "tabs":[ + { + "text":"tab1", + "icon":"/img/hhhh.png", + "refresh_press":Fasle, + "content":{ + "widgettype":"urlwidegt", + "url":"reggtY", + } + }, + { } - }, - { - } - ] + ] + }, } """ 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)