diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-02-11 18:52:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-11 18:52:01 +0100 |
| commit | cee9aa0d1d6f0173643e6480b4e11fc1f27f0ffb (patch) | |
| tree | 249897ecbc6942e404088a22fd7e7dd822896b60 /lib/gui/lettering/main_panel.py | |
| parent | b7f5e94fd2c39bf386fe116ac172402ca99dce5e (diff) | |
lettering tools: remember last font (#3498)
Diffstat (limited to 'lib/gui/lettering/main_panel.py')
| -rw-r--r-- | lib/gui/lettering/main_panel.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gui/lettering/main_panel.py b/lib/gui/lettering/main_panel.py index 6bb7219e..67e0db7f 100644 --- a/lib/gui/lettering/main_panel.py +++ b/lib/gui/lettering/main_panel.py @@ -17,14 +17,13 @@ from ...lettering.categories import FONT_CATEGORIES from ...stitch_plan import stitch_groups_to_stitch_plan from ...svg.tags import INKSTITCH_LETTERING from ...utils import DotDict, cache +from ...utils.settings import global_settings from ...utils.threading import ExitThread, check_stop_flag from .. import PresetsPanel, PreviewRenderer, info_dialog from . import LetteringHelpPanel, LetteringOptionsPanel class LetteringPanel(wx.Panel): - DEFAULT_FONT = "small_font" - def __init__(self, parent, simulator, group, metadata=None, background_color='white'): self.parent = parent self.simulator = simulator @@ -186,7 +185,7 @@ class LetteringPanel(wx.Panel): @property def default_font(self): try: - return self.fonts_by_id[self.DEFAULT_FONT] + return self.fonts[global_settings['last_font']] except KeyError: return list(self.fonts.values())[0] @@ -210,6 +209,7 @@ class LetteringPanel(wx.Panel): def on_font_changed(self, event=None): font = self.fonts.get(self.options_panel.font_chooser.GetValue(), self.default_font) self.settings.font = font.marked_custom_font_id + global_settings['last_font'] = font.marked_custom_font_name filter_size = self.options_panel.font_size_filter.GetValue() self.options_panel.scale_spinner.SetRange(int(font.min_scale * 100), int(font.max_scale * 100)) |
