This commit is contained in:
yumoqing 2020-11-27 01:45:57 -08:00
parent 09dc73554e
commit d9f56aa96a
3 changed files with 13 additions and 42 deletions

View File

@ -6,31 +6,6 @@ from kivy.uix.label import Label
from kivy.app import App from kivy.app import App
from .utils import CSize 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): class PageContainer(FloatLayout):
def __init__(self,**kw): def __init__(self,**kw):
super().__init__(**kw) super().__init__(**kw)

View File

@ -217,7 +217,3 @@ class ToolPage(BGColorBehavior, BoxLayout):
self.add_widget(self.content) self.add_widget(self.content)
self.add_widget(self.toolbar) self.add_widget(self.toolbar)
if __name__ == '__main__':
from blocksapp import BlocksApp
app = BlocksApp()
app.run()