This commit is contained in:
yumoqing 2021-02-03 14:44:59 +08:00
parent cd2e00306c
commit 567e526e29
3 changed files with 15 additions and 4 deletions

View File

@ -648,11 +648,19 @@ class Blocks(EventDispatcher):
if w:
return find_widget_by_id(id, w)
return None
ids = id.split('.')
app = App.get_running_app()
if id.startswith('/self') or id.startswith('root'):
fid = ids[0]
if fid == '/self' or fid == 'root':
from_widget = app.root
ids[0] = 'self'
if fid == 'Window':
from_widget == Window
ids[0] = 'self'
if fid == 'app':
return app
if from_widget is None:
from_widget = app.root
for id in ids:

View File

@ -10,12 +10,12 @@ desktopOSs=[
"macosx"
]
class WidgetReady(EventDispatcher):
class WidgetReady(object):
fullscreen = BooleanProperty(False)
_fullscreen_state = False
def __init__(self):
def __init__(self, **kw):
self.register_event_type('on_ready')
self._fullscreen_state = False
self._ready = False
def on_ready(self):

View File

@ -24,8 +24,11 @@ from .message import Conform
from .pagepanel import PagePanel
from .markdown import Markdown
from .custom_camera import CustomCamera, QrReader
from .camerawithmic import CameraWithMic, ScreenWithMic
r = Factory.register
r('ScreenWithMic', ScreenWithMic)
r('CameraWithMic', CameraWithMic)
r('CustomCamera', CustomCamera)
r('QrReader', QrReader)
r('Markdown', Markdown)