Commit 2c5267ea82141e1cc0de7353bbda6993576331d7
1 parent
3d7e12f3
Exists in
master
Increased the size of spinctrl
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
invesalius/gui/widgets/inv_spinctrl.py
@@ -76,10 +76,12 @@ class InvSpinCtrl(wx.Panel): | @@ -76,10 +76,12 @@ class InvSpinCtrl(wx.Panel): | ||
76 | def SetMin(self, min_value): | 76 | def SetMin(self, min_value): |
77 | self._min_value = min_value | 77 | self._min_value = min_value |
78 | self.SetValue(self._value) | 78 | self.SetValue(self._value) |
79 | + self.CalcSizeFromTextSize() | ||
79 | 80 | ||
80 | def SetMax(self, max_value): | 81 | def SetMax(self, max_value): |
81 | self._max_value = max_value | 82 | self._max_value = max_value |
82 | self.SetValue(self._value) | 83 | self.SetValue(self._value) |
84 | + self.CalcSizeFromTextSize() | ||
83 | 85 | ||
84 | def SetRange(self, min_value, max_value): | 86 | def SetRange(self, min_value, max_value): |
85 | self.SetMin(min_value) | 87 | self.SetMin(min_value) |
@@ -108,7 +110,7 @@ class InvSpinCtrl(wx.Panel): | @@ -108,7 +110,7 @@ class InvSpinCtrl(wx.Panel): | ||
108 | # To calculate best width to spinctrl | 110 | # To calculate best width to spinctrl |
109 | if text is None: | 111 | if text is None: |
110 | text = "{}".format( | 112 | text = "{}".format( |
111 | - max(len(str(self._max_value)), len(str(self._min_value))) * "M" | 113 | + max(len(str(self._max_value)), len(str(self._min_value)), 5) * "M" |
112 | ) | 114 | ) |
113 | 115 | ||
114 | dc = wx.WindowDC(self) | 116 | dc = wx.WindowDC(self) |