From bf2e9bc1e3a90d0125e0e1b2441640e3fe1ba8ea Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 4 Jan 2021 19:55:38 +0800 Subject: [PATCH] bugfix --- kivyblocks/blocks.py | 8 +++++++- kivyblocks/ready.py | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/kivyblocks/blocks.py b/kivyblocks/blocks.py index 59a02ac..fb96a70 100755 --- a/kivyblocks/blocks.py +++ b/kivyblocks/blocks.py @@ -533,7 +533,7 @@ class Blocks(EventDispatcher): @classmethod def getWidgetById(self,id,from_widget=None): - def find_widget_by_id(id, from_widget=None): + def find_widget_by_id(id, from_widget): if id=='self': return from_widget if hasattr(from_widget,'widget_id'): @@ -547,6 +547,12 @@ class Blocks(EventDispatcher): ret = find_widget_by_id(id,from_widget=c) if ret: return ret + app = App.get_running_app() + if from_widget == app.root: + w = getattr(app,'fs_widget',None) + if w: + print('full screen ...............................') + return find_widget_by_id(id, w) return None ids = id.split('.') app = App.get_running_app() diff --git a/kivyblocks/ready.py b/kivyblocks/ready.py index baced5c..303b163 100644 --- a/kivyblocks/ready.py +++ b/kivyblocks/ready.py @@ -1,6 +1,7 @@ from kivy.event import EventDispatcher from kivy.core.window import Window from kivy.utils import platform +from kivy.app import App from kivy.properties import BooleanProperty desktopOSs=[ @@ -64,8 +65,10 @@ class WidgetReady(EventDispatcher): 'no parent.') return + app = App.get_running_app() if value: Window.fullscreen = True + app.fs_widget = self self._fullscreen_state = state = { 'parent': self.parent, 'pos': self.pos, @@ -91,6 +94,7 @@ class WidgetReady(EventDispatcher): self.pos_hint = {} self.size_hint = (1, 1) else: + app.fs_widget = None Window.fullscreen = False #if platform in desktopOSs: # Window.restore()