Skip to content

Commit 7a80bac

Browse files
committed
Applies styling to HTML code text area.
1 parent e219a09 commit 7a80bac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tkintermd/frame.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,19 @@ def load_style(self, stylename):
359359
kwargs['font'] = font
360360
kwargs['underline'] = opts['underline']
361361
self.text_area.tag_configure(str(token), **kwargs)
362+
self.preview_html.tag_configure(str(token), **kwargs)
362363
self.syntax_highlighting_tags.append(str(token))
363364
# print(self.style.background_color or 'white', self.text_area.tag_cget("Token.Text", "foreground") or 'black', stylename)
364365
self.text_area.configure(bg=self.style.background_color or 'white',
365366
fg=self.text_area.tag_cget("Token.Text", "foreground") or 'black',
366367
selectbackground=self.style.highlight_color,
367368
)
368369
self.text_area.tag_configure(str(Generic.StrongEmph), font=('Monospace', 10, 'bold', 'italic'))
370+
self.preview_html.configure(bg=self.style.background_color or 'white',
371+
fg=self.preview_html.tag_cget("Token.Text", "foreground") or 'black',
372+
selectbackground=self.style.highlight_color,
373+
)
374+
self.preview_html.tag_configure(str(Generic.StrongEmph), font=('Monospace', 10, 'bold', 'italic'))
369375
self.syntax_highlighting_tags.append(str(Generic.StrongEmph))
370376
self.css = 'body {background-color: %s; color: %s}' % (
371377
self.style.background_color or 'white',

0 commit comments

Comments
 (0)