This commit is contained in:
yumoqing 2021-06-29 10:23:30 +08:00
parent 4ee5c5142f
commit 9ee2a08700

View File

@ -1,6 +1,7 @@
from kivy.clock import Clock
from kivy.uix.boxlayout import BoxLayout
from kivy.factory import Factory
from kivy.core.window import Window
from kivyblocks.ready import WidgetReady
@ -18,10 +19,14 @@ class TwoSides(WidgetReady, BoxLayout):
def on_size(self,*args):
if self.width >= self.height:
print('twosides.py:Window.rotation=', Window.rotation,
Window.size)
if not self.landscape_widget in self.children:
self.clear_widgets()
self.add_widget(self.landscape_widget)
else:
print('twosides.py:Window.rotation=', Window.rotation,
Window.size)
if not self.portrait_widget in self.children:
self.clear_widgets()
self.add_widget(self.portrait_widget)