|
1 | 1 | #usr/bin/python3 |
2 | 2 |
|
3 | | -version = __version__ = "0.39.0.4 Unreleased\n , VSeparator added (spelling error), added default key for one_line_progress_meter, auto-add keys to tables & trees, Graph.draw_image now uses image_data property instead of calling set_image" |
| 3 | +version = __version__ = "0.39.0.5 Unreleased\n , VSeparator added (spelling error), added default key for one_line_progress_meter, auto-add keys to tables & trees, Graph.draw_image now uses image_data property instead of calling set_image, added theme_add_new" |
4 | 4 |
|
5 | 5 | port = 'PySimpleGUIWeb' |
6 | 6 |
|
@@ -1544,7 +1544,7 @@ def __init__(self, file_path_name=None, **kwargs): |
1544 | 1544 | self.load(image) |
1545 | 1545 |
|
1546 | 1546 | def load(self, file_path_name): |
1547 | | - if type(file_path_name) is bytes or len(file_path_name) > 200: |
| 1547 | + if type(file_path_name) is bytes: |
1548 | 1548 | try: |
1549 | 1549 | #here a base64 image is received |
1550 | 1550 | self.imagedata = base64.b64decode(file_path_name, validate=True) |
@@ -2309,6 +2309,9 @@ def _GetElementAtLocation(self, location): |
2309 | 2309 | layout = Layout |
2310 | 2310 |
|
2311 | 2311 |
|
| 2312 | +Col = Column |
| 2313 | + |
| 2314 | + |
2312 | 2315 | # ---------------------------------------------------------------------- # |
2313 | 2316 | # Menu # |
2314 | 2317 | # ---------------------------------------------------------------------- # |
@@ -7261,6 +7264,22 @@ def theme_list(): |
7261 | 7264 | return list_of_look_and_feel_values() |
7262 | 7265 |
|
7263 | 7266 |
|
| 7267 | +def theme_add_new(new_theme_name, new_theme_dict): |
| 7268 | + """ |
| 7269 | + Add a new theme to the dictionary of themes |
| 7270 | +
|
| 7271 | + :param new_theme_name: text to display in element |
| 7272 | + :type new_theme_name: (str) |
| 7273 | + :param new_theme_dict: text to display in element |
| 7274 | + :type new_theme_dict: (dict) |
| 7275 | + """ |
| 7276 | + global LOOK_AND_FEEL_TABLE |
| 7277 | + try: |
| 7278 | + LOOK_AND_FEEL_TABLE[new_theme_name] = new_theme_dict |
| 7279 | + except Exception as e: |
| 7280 | + print('Exception during adding new theme {}'.format(e)) |
| 7281 | + |
| 7282 | + |
7264 | 7283 | def theme_previewer(columns=12): |
7265 | 7284 | """ |
7266 | 7285 | Show a window with all of the color themes - takes a while so be patient |
|
0 commit comments