Commit 9c8793421a4fa27263896a5940c2e9492b5ed01c
1 parent
940329e6
Exists in
master
and in
6 other branches
ENH: Text size on win32
Showing
4 changed files
with
35 additions
and
15 deletions
Show diff stats
invesalius/gui/data_notebook.py
@@ -16,6 +16,8 @@ | @@ -16,6 +16,8 @@ | ||
16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais | 16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
17 | # detalhes. | 17 | # detalhes. |
18 | #-------------------------------------------------------------------------- | 18 | #-------------------------------------------------------------------------- |
19 | +import sys | ||
20 | + | ||
19 | import Image | 21 | import Image |
20 | 22 | ||
21 | import wx | 23 | import wx |
@@ -34,7 +36,8 @@ class NotebookPanel(wx.Panel): | @@ -34,7 +36,8 @@ class NotebookPanel(wx.Panel): | ||
34 | # TODO: check under Windows and Linux | 36 | # TODO: check under Windows and Linux |
35 | # this was necessary under MacOS: | 37 | # this was necessary under MacOS: |
36 | #if wx.Platform == "__WXMAC__": | 38 | #if wx.Platform == "__WXMAC__": |
37 | - book.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 39 | + if sys.platform != 'win32': |
40 | + book.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
38 | 41 | ||
39 | book.AddPage(MasksListCtrlPanel(book), "Masks") | 42 | book.AddPage(MasksListCtrlPanel(book), "Masks") |
40 | book.AddPage(SurfacesListCtrlPanel(book), "Surfaces") | 43 | book.AddPage(SurfacesListCtrlPanel(book), "Surfaces") |
@@ -114,8 +117,9 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | @@ -114,8 +117,9 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | ||
114 | bitmap.SetWidth(16) | 117 | bitmap.SetWidth(16) |
115 | bitmap.SetHeight(16) | 118 | bitmap.SetHeight(16) |
116 | img_check = self.imagelist.Add(bitmap) | 119 | img_check = self.imagelist.Add(bitmap) |
117 | - | ||
118 | - self.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL) | 120 | + |
121 | + if sys.platform != 'win32': | ||
122 | + self.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL) | ||
119 | 123 | ||
120 | self.image_gray = Image.open("../icons/object_colour.jpg") | 124 | self.image_gray = Image.open("../icons/object_colour.jpg") |
121 | 125 | ||
@@ -240,7 +244,8 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | @@ -240,7 +244,8 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | ||
240 | bitmap.SetHeight(16) | 244 | bitmap.SetHeight(16) |
241 | img_check = self.imagelist.Add(bitmap) | 245 | img_check = self.imagelist.Add(bitmap) |
242 | 246 | ||
243 | - self.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL) | 247 | + if sys.platform != 'win32': |
248 | + self.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL) | ||
244 | 249 | ||
245 | self.image_gray = Image.open("../icons/object_colour.jpg") | 250 | self.image_gray = Image.open("../icons/object_colour.jpg") |
246 | 251 | ||
@@ -368,7 +373,8 @@ class MeasuresListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | @@ -368,7 +373,8 @@ class MeasuresListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | ||
368 | bitmap.SetHeight(16) | 373 | bitmap.SetHeight(16) |
369 | self.img_colour = self.imagelist.Add(bitmap) | 374 | self.img_colour = self.imagelist.Add(bitmap) |
370 | 375 | ||
371 | - self.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL) | 376 | + if sys.platform != 'win32': |
377 | + self.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL) | ||
372 | 378 | ||
373 | def OnItemActivated(self, evt): | 379 | def OnItemActivated(self, evt): |
374 | self.ToggleItem(evt.m_itemIndex) | 380 | self.ToggleItem(evt.m_itemIndex) |
@@ -449,7 +455,8 @@ class AnnotationsListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | @@ -449,7 +455,8 @@ class AnnotationsListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | ||
449 | bitmap.SetHeight(16) | 455 | bitmap.SetHeight(16) |
450 | self.img_colour = self.imagelist.Add(bitmap) | 456 | self.img_colour = self.imagelist.Add(bitmap) |
451 | 457 | ||
452 | - self.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL) | 458 | + if sys.platform != 'win32': |
459 | + self.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL) | ||
453 | 460 | ||
454 | def OnItemActivated(self, evt): | 461 | def OnItemActivated(self, evt): |
455 | self.ToggleItem(evt.m_itemIndex) | 462 | self.ToggleItem(evt.m_itemIndex) |
invesalius/gui/task_slice.py
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
17 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais | 17 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
18 | # detalhes. | 18 | # detalhes. |
19 | #-------------------------------------------------------------------------- | 19 | #-------------------------------------------------------------------------- |
20 | +import sys | ||
20 | 21 | ||
21 | import wx | 22 | import wx |
22 | import wx.lib.colourselect as csel | 23 | import wx.lib.colourselect as csel |
@@ -105,7 +106,8 @@ class InnerTaskPanel(wx.Panel): | @@ -105,7 +106,8 @@ class InnerTaskPanel(wx.Panel): | ||
105 | 106 | ||
106 | # Button to fold to select region task | 107 | # Button to fold to select region task |
107 | button_next = wx.Button(self, -1, "Create 3D surface") | 108 | button_next = wx.Button(self, -1, "Create 3D surface") |
108 | - button_next.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 109 | + if sys.platform != 'win32': |
110 | + button_next.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
109 | button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) | 111 | button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) |
110 | 112 | ||
111 | # Add line sizers into main sizer | 113 | # Add line sizers into main sizer |
@@ -227,7 +229,8 @@ class MaskProperties(wx.Panel): | @@ -227,7 +229,8 @@ class MaskProperties(wx.Panel): | ||
227 | combo_mask_name = wx.ComboBox(self, -1, "", choices= MASK_LIST, | 229 | combo_mask_name = wx.ComboBox(self, -1, "", choices= MASK_LIST, |
228 | style=wx.CB_DROPDOWN|wx.CB_READONLY) | 230 | style=wx.CB_DROPDOWN|wx.CB_READONLY) |
229 | combo_mask_name.SetSelection(0) # wx.CB_SORT | 231 | combo_mask_name.SetSelection(0) # wx.CB_SORT |
230 | - combo_mask_name.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 232 | + if sys.platform != 'win32': |
233 | + combo_mask_name.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
231 | self.combo_mask_name = combo_mask_name | 234 | self.combo_mask_name = combo_mask_name |
232 | 235 | ||
233 | # Mask colour | 236 | # Mask colour |
@@ -248,7 +251,8 @@ class MaskProperties(wx.Panel): | @@ -248,7 +251,8 @@ class MaskProperties(wx.Panel): | ||
248 | choices=[],#THRESHOLD_LIST | 251 | choices=[],#THRESHOLD_LIST |
249 | style=wx.CB_DROPDOWN|wx.CB_READONLY) | 252 | style=wx.CB_DROPDOWN|wx.CB_READONLY) |
250 | combo_thresh.SetSelection(0) | 253 | combo_thresh.SetSelection(0) |
251 | - combo_thresh.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 254 | + if sys.platform != 'win32': |
255 | + combo_thresh.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
252 | self.combo_thresh = combo_thresh | 256 | self.combo_thresh = combo_thresh |
253 | 257 | ||
254 | ## LINE 4 | 258 | ## LINE 4 |
@@ -414,7 +418,8 @@ class EditionTools(wx.Panel): | @@ -414,7 +418,8 @@ class EditionTools(wx.Panel): | ||
414 | choices = const.BRUSH_OP_NAME, | 418 | choices = const.BRUSH_OP_NAME, |
415 | style = wx.CB_DROPDOWN|wx.CB_READONLY) | 419 | style = wx.CB_DROPDOWN|wx.CB_READONLY) |
416 | combo_brush_op.SetSelection(const.DEFAULT_BRUSH_OP) | 420 | combo_brush_op.SetSelection(const.DEFAULT_BRUSH_OP) |
417 | - combo_brush_op.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 421 | + if sys.platform != 'win32': |
422 | + combo_brush_op.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
418 | self.combo_brush_op = combo_brush_op | 423 | self.combo_brush_op = combo_brush_op |
419 | 424 | ||
420 | # Sizer which represents the second line | 425 | # Sizer which represents the second line |
invesalius/gui/task_surface.py
@@ -16,6 +16,8 @@ | @@ -16,6 +16,8 @@ | ||
16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais | 16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
17 | # detalhes. | 17 | # detalhes. |
18 | #-------------------------------------------------------------------------- | 18 | #-------------------------------------------------------------------------- |
19 | +import sys | ||
20 | + | ||
19 | import wx | 21 | import wx |
20 | import wx.lib.colourselect as csel | 22 | import wx.lib.colourselect as csel |
21 | import wx.lib.hyperlink as hl | 23 | import wx.lib.hyperlink as hl |
@@ -98,7 +100,8 @@ class InnerTaskPanel(wx.Panel): | @@ -98,7 +100,8 @@ class InnerTaskPanel(wx.Panel): | ||
98 | 100 | ||
99 | # Button to fold to select region task | 101 | # Button to fold to select region task |
100 | button_next = wx.Button(self, -1, "Next step") | 102 | button_next = wx.Button(self, -1, "Next step") |
101 | - button_next.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 103 | + if sys.platform != 'win32': |
104 | + button_next.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
102 | #button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) | 105 | #button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) |
103 | 106 | ||
104 | # Add line sizers into main sizer | 107 | # Add line sizers into main sizer |
@@ -168,7 +171,8 @@ class NewSurfaceDialog(wx.Dialog): | @@ -168,7 +171,8 @@ class NewSurfaceDialog(wx.Dialog): | ||
168 | combo_surface_name = wx.ComboBox(self, -1, "", choices= MASK_LIST, | 171 | combo_surface_name = wx.ComboBox(self, -1, "", choices= MASK_LIST, |
169 | style=wx.CB_DROPDOWN|wx.CB_READONLY) | 172 | style=wx.CB_DROPDOWN|wx.CB_READONLY) |
170 | combo_surface_name.SetSelection(0) | 173 | combo_surface_name.SetSelection(0) |
171 | - combo_surface_name.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 174 | + if sys.platform != 'win32': |
175 | + combo_surface_name.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
172 | self.combo_surface_name = combo_surface_name | 176 | self.combo_surface_name = combo_surface_name |
173 | 177 | ||
174 | 178 | ||
@@ -278,7 +282,8 @@ class SurfaceProperties(wx.Panel): | @@ -278,7 +282,8 @@ class SurfaceProperties(wx.Panel): | ||
278 | combo_surface_name = wx.ComboBox(self, -1, "", choices= SURFACE_LIST, | 282 | combo_surface_name = wx.ComboBox(self, -1, "", choices= SURFACE_LIST, |
279 | style=wx.CB_DROPDOWN|wx.CB_READONLY) | 283 | style=wx.CB_DROPDOWN|wx.CB_READONLY) |
280 | combo_surface_name.SetSelection(0) | 284 | combo_surface_name.SetSelection(0) |
281 | - combo_surface_name.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 285 | + if sys.platform != 'win32': |
286 | + combo_surface_name.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
282 | combo_surface_name.Bind(wx.EVT_COMBOBOX, self.OnComboName) | 287 | combo_surface_name.Bind(wx.EVT_COMBOBOX, self.OnComboName) |
283 | self.combo_surface_name = combo_surface_name | 288 | self.combo_surface_name = combo_surface_name |
284 | 289 |
invesalius/gui/widgets/gradient.py
@@ -21,6 +21,7 @@ | @@ -21,6 +21,7 @@ | ||
21 | #-------------------------------------------------------------------------- | 21 | #-------------------------------------------------------------------------- |
22 | 22 | ||
23 | import array | 23 | import array |
24 | +import sys | ||
24 | 25 | ||
25 | import numpy | 26 | import numpy |
26 | import vtk | 27 | import vtk |
@@ -506,13 +507,15 @@ class GradientSlider(wx.Panel): | @@ -506,13 +507,15 @@ class GradientSlider(wx.Panel): | ||
506 | self.SpinMin = wx.lib.intctrl.IntCtrl(self, size=(40,20)) | 507 | self.SpinMin = wx.lib.intctrl.IntCtrl(self, size=(40,20)) |
507 | #self.SpinMin.SetLimited(True) | 508 | #self.SpinMin.SetLimited(True) |
508 | self.SpinMin.SetBounds(self.SliderData.minRange, self.SliderData.maxRange) | 509 | self.SpinMin.SetBounds(self.SliderData.minRange, self.SliderData.maxRange) |
509 | - self.SpinMin.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 510 | + if sys.platform != 'win32': |
511 | + self.SpinMin.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
510 | self.SpinMin.SetValue(self.SliderData.minRange) | 512 | self.SpinMin.SetValue(self.SliderData.minRange) |
511 | 513 | ||
512 | self.SpinMax = wx.lib.intctrl.IntCtrl(self, size=(40,20)) | 514 | self.SpinMax = wx.lib.intctrl.IntCtrl(self, size=(40,20)) |
513 | #self.SpinMax.SetLimited(True) | 515 | #self.SpinMax.SetLimited(True) |
514 | self.SpinMax.SetBounds(self.SliderData.minRange, self.SliderData.maxRange) | 516 | self.SpinMax.SetBounds(self.SliderData.minRange, self.SliderData.maxRange) |
515 | - self.SpinMax.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | 517 | + if sys.platform != 'win32': |
518 | + self.SpinMax.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) | ||
516 | self.SpinMax.SetValue(self.SliderData.maxRange) | 519 | self.SpinMax.SetValue(self.SliderData.maxRange) |
517 | 520 | ||
518 | self.GradientPanel = GradientPanel(self, -1, self.SliderData) | 521 | self.GradientPanel = GradientPanel(self, -1, self.SliderData) |