summaryrefslogtreecommitdiff
path: root/lib/gui/lettering/option_panel.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-05-09 20:23:26 +0200
committerGitHub <noreply@github.com>2025-05-09 20:23:26 +0200
commit21216f16166d2f978f439b86fd51d4e3fc995ae6 (patch)
treedbb7075c39c1f3d5985ba63d4c1c1b38b942ffb4 /lib/gui/lettering/option_panel.py
parent3121d5365b9a13570531288f6fe2cd4b3f29ec1f (diff)
lettering: options to scolled panel (#3714)
Diffstat (limited to 'lib/gui/lettering/option_panel.py')
-rw-r--r--lib/gui/lettering/option_panel.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/gui/lettering/option_panel.py b/lib/gui/lettering/option_panel.py
index a6c39979..e768a29b 100644
--- a/lib/gui/lettering/option_panel.py
+++ b/lib/gui/lettering/option_panel.py
@@ -1,13 +1,14 @@
import wx
+from wx.lib.scrolledpanel import ScrolledPanel
from ...i18n import _
from ...lettering.categories import FONT_CATEGORIES, FontCategory
-class LetteringOptionsPanel(wx.Panel):
+class LetteringOptionsPanel(ScrolledPanel):
def __init__(self, parent, panel):
self.panel = panel
- wx.Panel.__init__(self, parent)
+ ScrolledPanel.__init__(self, parent)
outer_sizer = wx.BoxSizer(wx.VERTICAL)
@@ -70,7 +71,7 @@ class LetteringOptionsPanel(wx.Panel):
self.font_selector_box = wx.StaticBox(self, wx.ID_ANY, label=_("Font"))
font_selector_sizer = wx.StaticBoxSizer(self.font_selector_box, wx.VERTICAL)
font_selector_box = wx.BoxSizer(wx.HORIZONTAL)
- font_selector_box.Add(self.font_chooser, 4, wx.EXPAND | wx.TOP | wx.BOTTOM | wx.RIGHT, 10)
+ font_selector_box.Add(self.font_chooser, 1, wx.EXPAND | wx.TOP | wx.BOTTOM | wx.RIGHT, 10)
font_selector_sizer.Add(font_selector_box, 0, wx.EXPAND | wx.LEFT | wx.TOP | wx.RIGHT, 10)
font_selector_sizer.Add(self.font_description, 0, wx.EXPAND | wx.ALL, 10)
font_selector_sizer.Add(font_description_sizer, 0, wx.EXPAND | wx.ALL, 10)
@@ -142,12 +143,13 @@ class LetteringOptionsPanel(wx.Panel):
# text input
self.text_input_box = wx.StaticBox(self, wx.ID_ANY, label=_("Text"))
- self.text_editor = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_DONTWRAP)
+ self.text_editor = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_DONTWRAP, size=(50, 100))
self.text_editor.Bind(wx.EVT_TEXT, lambda event: self.panel.on_change("text", event))
text_input_sizer = wx.StaticBoxSizer(self.text_input_box, wx.VERTICAL)
- text_input_sizer.Add(self.text_editor, 2, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, 10)
- outer_sizer.Add(text_input_sizer, 2, wx.EXPAND | wx.LEFT | wx.TOP | wx.RIGHT, 10)
+ text_input_sizer.Add(self.text_editor, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, 10)
+ outer_sizer.Add(text_input_sizer, 1, wx.EXPAND | wx.LEFT | wx.TOP | wx.RIGHT, 10)
# set panel sizer
- self.SetSizerAndFit(outer_sizer)
+ self.SetSizer(outer_sizer)
+ self.SetupScrolling()