This commit is contained in:
yumoqing 2019-12-23 10:07:49 +08:00
parent 07a1d24d74
commit 7f5c8ff1ff
2 changed files with 8 additions and 5 deletions

View File

@ -17,7 +17,7 @@ class PageContainer(FloatLayout):
Window.bind(size=self.on_window_size) Window.bind(size=self.on_window_size)
def on_window_size(self,o,v=None): def on_window_size(self,o,v=None):
if self.size != Window.size: if self.size[0] != Window.size[0] or self.size[1] != Window.size[1]:
print('on_window_size event fired ....',self.size, Window.size) print('on_window_size event fired ....',self.size, Window.size)
self.size = Window.size self.size = Window.size
self.reshowBackButton() self.reshowBackButton()

View File

@ -1,5 +1,6 @@
import os import os
import sys import sys
from kivy.utils import platform
from traceback import print_exc from traceback import print_exc
from kivy.core.window import Window from kivy.core.window import Window
from kivy.uix.floatlayout import FloatLayout from kivy.uix.floatlayout import FloatLayout
@ -217,7 +218,6 @@ class VPlayer(FloatLayout):
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,
@ -225,7 +225,9 @@ class VPlayer(FloatLayout):
'size_hint': self.size_hint, 'size_hint': self.size_hint,
'window_children': window.children[:]} 'window_children': window.children[:]}
Window.maximize() print('vplayer fullscreen,platform=',platform)
if platform in ['windows', 'linux','macOS' ]:
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)
@ -253,8 +255,9 @@ class VPlayer(FloatLayout):
self.size = state['size'] self.size = state['size']
if state['parent'] is not window: if state['parent'] is not window:
state['parent'].add_widget(self) state['parent'].add_widget(self)
Window.size = state['WindowSize'] print('vplayer fullscreen,platform=',platform)
print('state_size=',state['WindowSize'], 'windowsize=',Window.size) if platform in ['windows', 'linux','macOS' ]:
Window.restore()
def buildMenu(self,obj,touch): def buildMenu(self,obj,touch):
if not self.collide_point(*touch.pos): if not self.collide_point(*touch.pos):