From d9f56aa96a8139c73b063139c0f78775686fef88 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 27 Nov 2020 01:45:57 -0800 Subject: [PATCH] bugfix --- kivyblocks/blocksapp.py | 26 +++++++++++++------------- kivyblocks/pagescontainer.py | 25 ------------------------- kivyblocks/toolbar.py | 4 ---- 3 files changed, 13 insertions(+), 42 deletions(-) diff --git a/kivyblocks/blocksapp.py b/kivyblocks/blocksapp.py index 254a8af..19ad9eb 100644 --- a/kivyblocks/blocksapp.py +++ b/kivyblocks/blocksapp.py @@ -93,19 +93,19 @@ def closeWorkers(): app.workers.running = False def appBlocksHack(app): - config = getConfig() - # app.on_close = on_close - app.getAuthHeader = getAuthHeader - app.__del__ = closeWorkers - Window.bind(on_request_close=app.on_close) - app.serverinfo = ServerInfo() - app.title = 'Test Title' - app.blocks = Blocks() - app.workers = Workers(maxworkers=config.maxworkers or 80) - app.workers.start() - app.hc = HttpClient() - WindowBase.softinput_mode='below_target' - + config = getConfig() + # app.on_close = on_close + app.getAuthHeader = getAuthHeader + app.__del__ = closeWorkers + Window.bind(on_request_close=app.on_close) + app.serverinfo = ServerInfo() + app.title = 'Test Title' + app.blocks = Blocks() + app.workers = Workers(maxworkers=config.maxworkers or 80) + app.workers.start() + app.hc = HttpClient() + WindowBase.softinput_mode='below_target' + class BlocksApp(App): def build(self): appBlocksHack(self) diff --git a/kivyblocks/pagescontainer.py b/kivyblocks/pagescontainer.py index 3b23121..d2dbce5 100644 --- a/kivyblocks/pagescontainer.py +++ b/kivyblocks/pagescontainer.py @@ -6,31 +6,6 @@ from kivy.uix.label import Label from kivy.app import App from .utils import CSize -class TwinShapeMenuBar(BoxLayout): - def __init__(self,**kw): - pass - -class MultiPanel(BoxLayout): - def __init__(self,bar_width=CSize(2),**kw): - BoxLayout.__init__(self,**kw) - self.panels = [] - self.bar_width = bar_width - self.menubar = TwinShapeMenuBar(self,bar_width=bar_width) - self.cur_panel = None - self.bind(on_size=self.sizeChanged) - - def sizeChanged(self,*args): - if len(self.panels) == 0: - return - if len(self.panels) == 1: - self.cur_panel.height = self.height - self.menubar.height - self.cur_panel.width = self.height - self.menubar.width - return - - self.menubar.sizeChanged(self) - self.cur_panel.height = self.height - self.menubar.height - self.cur_panel.width = self.height - self.menubar.width - class PageContainer(FloatLayout): def __init__(self,**kw): super().__init__(**kw) diff --git a/kivyblocks/toolbar.py b/kivyblocks/toolbar.py index d793f29..07b437d 100644 --- a/kivyblocks/toolbar.py +++ b/kivyblocks/toolbar.py @@ -217,7 +217,3 @@ class ToolPage(BGColorBehavior, BoxLayout): self.add_widget(self.content) self.add_widget(self.toolbar) -if __name__ == '__main__': - from blocksapp import BlocksApp - app = BlocksApp() - app.run()