Skip to content

Commit

Permalink
Add background_color to show image and show animated image (#86)
Browse files Browse the repository at this point in the history
* Add background_color to show image and show animated image

* fix docstring
  • Loading branch information
AIIX authored Nov 30, 2022
1 parent 8bab80d commit 0aa1c05
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ovos_utils/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ def show_text(self, text, title=None, override_idle=None,
override_animations)

def show_image(self, url, caption=None,
title=None, fill=None,
title=None, fill=None, background_color=None,
override_idle=None, override_animations=False):
"""Display a GUI page for viewing an image.
Expand All @@ -827,6 +827,8 @@ def show_image(self, url, caption=None,
title (str): A title to display above the image content
fill (str): Fill type supports 'PreserveAspectFit',
'PreserveAspectCrop', 'Stretch'
background_color (str): A background color for
the page in hex i.e. #000000
override_idle (boolean, int):
True: Takes over the resting page indefinitely
(int): Delays resting page for the specified number of
Expand All @@ -839,11 +841,12 @@ def show_image(self, url, caption=None,
self["title"] = title
self["caption"] = caption
self["fill"] = fill
self["background_color"] = background_color
self.show_page("SYSTEM_ImageFrame.qml", override_idle,
override_animations)

def show_animated_image(self, url, caption=None,
title=None, fill=None,
title=None, fill=None, background_color=None,
override_idle=None, override_animations=False):
"""Display a GUI page for viewing an image.
Expand All @@ -853,6 +856,8 @@ def show_animated_image(self, url, caption=None,
title (str): A title to display above the image content
fill (str): Fill type supports 'PreserveAspectFit',
'PreserveAspectCrop', 'Stretch'
background_color (str): A background color for
the page in hex i.e. #000000
override_idle (boolean, int):
True: Takes over the resting page indefinitely
(int): Delays resting page for the specified number of
Expand All @@ -865,6 +870,7 @@ def show_animated_image(self, url, caption=None,
self["title"] = title
self["caption"] = caption
self["fill"] = fill
self["background_color"] = background_color
self.show_page("SYSTEM_AnimatedImageFrame.qml", override_idle,
override_animations)

Expand Down

0 comments on commit 0aa1c05

Please sign in to comment.