From 60cd1852f8e6fee7cfb32aa4475c3816b84e7d24 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 1 Dec 2020 15:22:04 +0800 Subject: [PATCH] bugfix --- kivyblocks/blocks.py | 2 +- kivyblocks/doubleface.py | 60 ---------------------------------------- 2 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 kivyblocks/doubleface.py diff --git a/kivyblocks/blocks.py b/kivyblocks/blocks.py index fd6b222..cc7998d 100755 --- a/kivyblocks/blocks.py +++ b/kivyblocks/blocks.py @@ -36,8 +36,8 @@ from .newvideo import Video from .ready import WidgetReady from .bgcolorbehavior import BGColorBehavior from .orientationlayout import OrientationLayout -from kivyblocks import doubleface from .threadcall import HttpClient +from .twosides import TwoSides def showError(e): print('error',e) diff --git a/kivyblocks/doubleface.py b/kivyblocks/doubleface.py deleted file mode 100644 index cd2e759..0000000 --- a/kivyblocks/doubleface.py +++ /dev/null @@ -1,60 +0,0 @@ -from kivy.clock import Clock -from kivy.uix.boxlayout import BoxLayout -from kivy.factory import Factory - -from kivyblocks.ready import WidgetReady - -class DoubleFace(WidgetReady, BoxLayout): - def __init__(self,landscape={},portrait={},**kw): - BoxLayout.__init__(self,**kw) - WidgetReady.__init__(self) - self.parenturl = kw.get('parenturl') - self.landscape_built = False - self.portrait_built = False - self.landscape_widget = None - self.portrait_widget = None - blocks = Factory.Blocks() - blocks.bind(on_built=self.landscape_build) - blocks.widgetBuild(landscape) - blocks = Factory.Blocks() - blocks.bind(on_built=self.portrait_build) - blocks.widgetBuild(portrait) - self.on_size_task = None - self.ready_task = None - - def ready(self, *args): - if self._ready: - return - if not self.landscape_built or not self.portrait_built: - if not self.ready_task is None: - self.ready_task.cancel() - self.ready_task = Clock.schedule_once(self.ready,0.2) - return - self.dispatch('on_ready') - self._ready = True - - def landscape_build(self,o,w): - self.landscape_widget = w - self.landscape_built = True - - def portrait_build(self,o,w): - self.portrait_widget = w - self.portrait_built = True - - def on_size(self,*args): - if not self.landscape_built or not self.portrait_built: - if not self.on_size_task is None: - self.on_size_task.cancel() - self.on_size_task = Clock.schedule_once(self.on_size,0.2) - return - if self.width >= self.height: - if not self.landscape_widget in self.children: - self.clear_widgets() - self.add_widget(self.landscape_widget) - else: - if not self.portrait_widget in self.children: - self.clear_widgets() - self.add_widget(self.portrait_widget) - - -Factory.register('DoubleFace',DoubleFace)