diff --git a/DemoPrograms/Demo_Theme_Add_Your_Own.py b/DemoPrograms/Demo_Theme_Add_Your_Own.py new file mode 100644 index 00000000..3a27eb29 --- /dev/null +++ b/DemoPrograms/Demo_Theme_Add_Your_Own.py @@ -0,0 +1,40 @@ +import PySimpleGUI as sg + +""" + Demo showing how to add your own theme. + + There are functions to make the job quick and easy. + + Copyright 2021 PySimpleGUI.org +""" + +# First make a dictionary with the required keys. +# Use only colors in the format of #RRGGBB +DarkGrey20 = {'BACKGROUND': '#19232D', + 'TEXT': '#ffffff', + 'INPUT': '#32414B', + 'TEXT_INPUT': '#ffffff', + 'SCROLL': '#505F69', + 'BUTTON': ('#ffffff', '#32414B'), + 'PROGRESS': ('#505F69', '#32414B'), + 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0, + } + +# Add your dictionary to the PySimpleGUI themes +sg.theme_add_new('DarkGrey20', DarkGrey20) + +# Switch your theme to use the newly added one +sg.theme('Dark Grey 20') + +def main(): + # Test it out! + try: + sg.popup_get_text('Dark Grey 20 looks like this.', image=sg.EMOJI_BASE64_HAPPY_THUMBS_UP) + except: + sg.popup_get_text('Dark Grey 20 looks like this.\n' + \ + 'Upgrading to 4.35.0+ will give you a nice emoji like the one above', + image=EMOJI_BASE64_HAPPY_THUMBS_UP) + +if __name__ == '__main__': + EMOJI_BASE64_HAPPY_THUMBS_UP = b'iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi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