This commit is contained in:
yumoqing 2019-12-23 09:46:11 +08:00
parent 35da623762
commit 82eacc96f7

View File

@ -214,8 +214,10 @@ class VPlayer(FloatLayout):
if value: if value:
Window.fullscreen = True Window.fullscreen = True
print('Window size=',Window.size) print('Window size=',Window.size)
self._fullscreen_state = state = { self._fullscreen_state = state = {
"WindowSize":Window.size,
'parent': self.parent, 'parent': self.parent,
'pos': self.pos, 'pos': self.pos,
'size': self.size, 'size': self.size,
@ -223,6 +225,7 @@ class VPlayer(FloatLayout):
'size_hint': self.size_hint, 'size_hint': self.size_hint,
'window_children': window.children[:]} 'window_children': window.children[:]}
Window.maximize()
# remove all window children # remove all window children
for child in window.children[:]: for child in window.children[:]:
window.remove_widget(child) window.remove_widget(child)
@ -241,6 +244,7 @@ class VPlayer(FloatLayout):
else: else:
Window.fullscreen = False Window.fullscreen = False
state = self._fullscreen_state state = self._fullscreen_state
Window.size = state['WindowSize']
window.remove_widget(self) window.remove_widget(self)
for child in state['window_children']: for child in state['window_children']:
window.add_widget(child) window.add_widget(child)