Parcourir la source

wxGUI: Fix Location Wizard titles being cut off. (#1774)

* Fix wizard titles from being cut off.
* Black formatting
* Set vertical size of title text based on font pixel height
* New line between self.page and font

Co-authored-by: Huidae Cho <grass4u@gmail.com>
Owen Smith il y a 2 ans
Parent
commit
d44cf8ebc7
1 fichiers modifiés avec 9 ajouts et 2 suppressions
  1. 9 2
      gui/wxpython/location_wizard/wizard.py

+ 9 - 2
gui/wxpython/location_wizard/wizard.py

@@ -98,11 +98,18 @@ class TitledPage(WizardPageSimple):
     def __init__(self, parent, title):
         self.page = WizardPageSimple.__init__(self, parent)
 
+        font = wx.Font(13, wx.SWISS, wx.NORMAL, wx.BOLD)
+        font_height = font.GetPixelSize()[1]
+
         # page title
         self.title = StaticText(
-            parent=self, id=wx.ID_ANY, label=title, style=wx.ALIGN_CENTRE_HORIZONTAL
+            parent=self,
+            id=wx.ID_ANY,
+            label=title,
+            style=wx.ALIGN_CENTRE_HORIZONTAL,
+            size=(-1, font_height),
         )
-        self.title.SetFont(wx.Font(13, wx.SWISS, wx.NORMAL, wx.BOLD))
+        self.title.SetFont(font)
         # main sizers
         self.pagesizer = wx.BoxSizer(wx.VERTICAL)