Skip to content

Commit

Permalink
Fixed some cases where the bgcolor in a PGUI wasn't set right
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckBoss committed Jul 29, 2020
1 parent 7135fc1 commit 1ee1870
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions JJMumbleBot/lib/pgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ def quick_gui(self, content, text_type="data", text_color=None, text_font=None,
self.display_box(channel=channel, user=user, ignore_whisper=ignore_whisper)
self.clear_display()

def quick_gui_img(self, directory, img_data, format_img=False, caption=None, caption_align='center', caption_font=None, bgcolor="black", channel=None, user=None, img_size=65536, cellspacing="5"):
def quick_gui_img(self, directory, img_data, format_img=False, caption=None, caption_align='center', caption_font=None, bgcolor=None, channel=None, user=None, img_size=65536, cellspacing="5"):
if self.box_open:
return False
if channel is None:
channel = runtime_utils.get_my_channel()

if bgcolor is None:
bgcolor = GS.cfg[C_PGUI_SETTINGS][P_CANVAS_IMG_BG_COL]
self.open_box(align='left', bgcolor=bgcolor, cellspacing=cellspacing)

if format_img:
Expand Down Expand Up @@ -94,13 +95,15 @@ def append_content(self, content):
self.content += content
return True

def make_content(self, text, text_type="data", text_color=None, text_font=None, text_align="center", bgcolor="black", image_bgcolor=None, image=False):
def make_content(self, text, text_type="data", text_color=None, text_font=None, text_align="center", bgcolor=None, image_bgcolor=None, image=False):
if not self.box_open:
return None
if image:
if image_bgcolor is None:
image_bgcolor = GS.cfg[C_PGUI_SETTINGS][P_CANVAS_IMG_BG_COL]
return PGUIHelper.img_content(text, text_align, image_bgcolor)
if bgcolor is None:
bgcolor = GS.cfg[C_PGUI_SETTINGS][P_CANVAS_BG_COL]
if text_color is None:
text_color = GS.cfg[C_PGUI_SETTINGS][P_CANVAS_TXT_COL]
if text_font is None:
Expand Down

0 comments on commit 1ee1870

Please sign in to comment.