Skip to content

Commit

Permalink
Merge pull request #72 from LupaDevStudio/68-fix-unloaded-image-when-…
Browse files Browse the repository at this point in the history
…opening-the-tutorial

fix white flash before first tutorial screen
  • Loading branch information
LupaDevStudio committed Dec 5, 2023
2 parents 57c9d9d + 93000ad commit d57c088
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions screens/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ def __init__(self, **kw):
font_name=PATH_TEXT_FONT,
**kw)

def on_enter(self, *args):
def on_pre_enter(self, *args):
self.ids.tutorial_text.text = TEXT.tutorial[self.counter_tutorial][0]
self.path_tutorial_image = PATH_IMAGES_TUTORIAL + TEXT.tutorial[self.counter_tutorial][1] + ".jpg"
return super().on_enter(*args)
self.path_tutorial_image = PATH_IMAGES_TUTORIAL + \
TEXT.tutorial[self.counter_tutorial][1] + ".jpg"
return super().on_pre_enter(*args)

def go_to_previous_slide(self):
"""
Expand All @@ -61,7 +62,8 @@ def go_to_previous_slide(self):
else:
self.counter_tutorial -= 1
self.ids.tutorial_text.text = TEXT.tutorial[self.counter_tutorial][0]
self.path_tutorial_image = PATH_IMAGES_TUTORIAL + TEXT.tutorial[self.counter_tutorial][1] + ".jpg"
self.path_tutorial_image = PATH_IMAGES_TUTORIAL + \
TEXT.tutorial[self.counter_tutorial][1] + ".jpg"

def go_to_next_slide(self):
"""
Expand Down Expand Up @@ -92,4 +94,5 @@ def go_to_next_slide(self):

else:
self.ids.tutorial_text.text = TEXT.tutorial[self.counter_tutorial][0]
self.path_tutorial_image = PATH_IMAGES_TUTORIAL + TEXT.tutorial[self.counter_tutorial][1] + ".jpg"
self.path_tutorial_image = PATH_IMAGES_TUTORIAL + \
TEXT.tutorial[self.counter_tutorial][1] + ".jpg"

0 comments on commit d57c088

Please sign in to comment.