From 526695fa9ad7af89055ddb28d6536ca069320e39 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Tue, 27 Feb 2024 00:30:19 +0600 Subject: [PATCH] Try setting size for graph input boxes as a workaround for wx bug --- gui/utils/inputs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gui/utils/inputs.py b/gui/utils/inputs.py index b2992dde6..35a150fe7 100644 --- a/gui/utils/inputs.py +++ b/gui/utils/inputs.py @@ -58,6 +58,9 @@ class InputValidator(metaclass=ABCMeta): class FloatBox(wx.TextCtrl): def __init__(self, parent, value, id=wx.ID_ANY, style=0, validator=None, **kwargs): + # Workaround for #2591 + if 'wxMac' in wx.PlatformInfo and 'size' not in kwargs: + kwargs['size'] = wx.Size(97, 26) super().__init__(parent=parent, id=id, style=style, **kwargs) self.Bind(wx.EVT_TEXT, self.OnText) self._storedValue = '' @@ -107,6 +110,9 @@ class FloatBox(wx.TextCtrl): class FloatRangeBox(wx.TextCtrl): def __init__(self, parent, value, id=wx.ID_ANY, style=0, **kwargs): + # Workaround for #2591 + if 'wxMac' in wx.PlatformInfo and 'size' not in kwargs: + kwargs['size'] = wx.Size(97, 26) super().__init__(parent=parent, id=id, style=style, **kwargs) self.Bind(wx.EVT_TEXT, self.OnText) self._storedValue = ''