bugfix
This commit is contained in:
parent
78ae037d9c
commit
38b67ebb60
@ -25,9 +25,9 @@ class OrientationLayout(WidgetReady, SwipeBehavior, FloatLayout):
|
|||||||
self.bind(on_swipe_right=self.toggle_second)
|
self.bind(on_swipe_right=self.toggle_second)
|
||||||
self.bind(size=self.on_size_changed)
|
self.bind(size=self.on_size_changed)
|
||||||
self.bind(pos=self.on_size_changed)
|
self.bind(pos=self.on_size_changed)
|
||||||
self.current_orient = None
|
self.second_showed = None
|
||||||
self.register_event_type('on_orientation_changed')
|
|
||||||
self.reready()
|
self.reready()
|
||||||
|
self.register_event_type('on_interactive')
|
||||||
|
|
||||||
def build_children(self, *args):
|
def build_children(self, *args):
|
||||||
blocks = Factory.Blocks()
|
blocks = Factory.Blocks()
|
||||||
@ -43,27 +43,22 @@ class OrientationLayout(WidgetReady, SwipeBehavior, FloatLayout):
|
|||||||
if self.second_flg:
|
if self.second_flg:
|
||||||
self.remove_widget(self.widget_second)
|
self.remove_widget(self.widget_second)
|
||||||
self.second_flg = False
|
self.second_flg = False
|
||||||
|
self.dispatch('on_interactive')
|
||||||
else:
|
else:
|
||||||
self.add_widget(self.widget_second)
|
self.add_widget(self.widget_second)
|
||||||
self.second_flg = True
|
self.second_flg = True
|
||||||
self.on_size_changed(self.size)
|
self.on_size_changed(self.size)
|
||||||
|
self.dispatch('on_interactive')
|
||||||
|
|
||||||
def on_size_changed(self,*args):
|
def on_size_changed(self,*args):
|
||||||
old_orient = self.current_orient
|
|
||||||
if self.isLandscape():
|
|
||||||
self.current_orient = 'landscape'
|
|
||||||
else:
|
|
||||||
self.current_orient = 'portrait'
|
|
||||||
if old_orient and old_orient != self.current_orient:
|
|
||||||
self.dispatch('on_orientation_changed')
|
|
||||||
|
|
||||||
Clock.schedule_once(self.two_widget_layout,0)
|
Clock.schedule_once(self.two_widget_layout,0)
|
||||||
|
|
||||||
def on_orientation_changed(self, *args):
|
def on_interactive(self, *args):
|
||||||
print('on_orientation_changed fired')
|
print('on_orientation_changed fired')
|
||||||
|
|
||||||
def two_widget_layout(self, *args):
|
def two_widget_layout(self, *args):
|
||||||
if not isinstance(self.widget_main, Widget) or not isinstance(self.widget_second, Widget):
|
if not isinstance(self.widget_main, Widget) or \
|
||||||
|
not isinstance(self.widget_second, Widget):
|
||||||
# Clock.schedule_once(self.two_widget_layout,0)
|
# Clock.schedule_once(self.two_widget_layout,0)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class OSCServer(EventDispatcher):
|
|||||||
"address":self.osc_server.getaddress()
|
"address":self.osc_server.getaddress()
|
||||||
}
|
}
|
||||||
|
|
||||||
def __del__(self):
|
def quit(self):
|
||||||
self.osc_server.stop_all()
|
self.osc_server.stop_all()
|
||||||
self.osc_server.terminate_server()
|
self.osc_server.terminate_server()
|
||||||
self.osc_server.join_server()
|
self.osc_server.join_server()
|
||||||
|
@ -43,9 +43,9 @@ class VResponsiveLayout(ScrollView):
|
|||||||
def setCols(self,*args):
|
def setCols(self,*args):
|
||||||
cols = round(self.width / self.org_box_width)
|
cols = round(self.width / self.org_box_width)
|
||||||
if cols < 1:
|
if cols < 1:
|
||||||
return
|
cols = 1
|
||||||
if isHandHold() and self.width < self.height:
|
if isHandHold() and self.width < self.height:
|
||||||
cols = self.org_cols
|
cols = 2
|
||||||
box_width = self.width / cols - 2
|
box_width = self.width / cols - 2
|
||||||
self._inner.cols = cols
|
self._inner.cols = cols
|
||||||
for w in self._inner.children:
|
for w in self._inner.children:
|
||||||
|
Loading…
Reference in New Issue
Block a user