|
23 | 23 | import os |
24 | 24 | import subprocess |
25 | 25 | import sys |
| 26 | +import webbrowser |
26 | 27 |
|
27 | 28 | MIN_PYTHON = (3, 8) |
28 | 29 | if sys.version_info < MIN_PYTHON: |
@@ -155,6 +156,8 @@ def __init__(self): |
155 | 156 | self.theme_preview = ttk.Label(self.window) |
156 | 157 | self.theme_preview.place(x=10, y=10) |
157 | 158 |
|
| 159 | + self.theme_author = ttk.Label(self.window) |
| 160 | + |
158 | 161 | sysmon_label = ttk.Label(self.window, text='Display configuration', font='bold') |
159 | 162 | sysmon_label.place(x=320, y=0) |
160 | 163 |
|
@@ -252,6 +255,17 @@ def load_theme_preview(self): |
252 | 255 | self.theme_preview_img = ImageTk.PhotoImage(theme_preview) |
253 | 256 | self.theme_preview.config(image=self.theme_preview_img) |
254 | 257 |
|
| 258 | + theme_data = get_theme_data(self.theme_cb.get()) |
| 259 | + author_name = theme_data.get('author', 'unknown') |
| 260 | + self.theme_author.config(text="Author: " + author_name) |
| 261 | + if author_name.startswith("@"): |
| 262 | + self.theme_author.config(foreground="#a3a3ff", cursor="hand2") |
| 263 | + self.theme_author.bind("<Button-1>", lambda e: webbrowser.open_new_tab("https://github.com/" + author_name[1:])) |
| 264 | + else: |
| 265 | + self.theme_author.config(foreground="#a3a3a3", cursor="") |
| 266 | + self.theme_author.unbind("<Button-1>") |
| 267 | + self.theme_author.place(x=10, y=self.theme_preview_img.height() + 15) |
| 268 | + |
255 | 269 | def load_config_values(self): |
256 | 270 | with open("config.yaml", "rt", encoding='utf8') as stream: |
257 | 271 | self.config, ind, bsi = ruamel.yaml.util.load_yaml_guess_indent(stream) |
|
0 commit comments