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 | 16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
17 | 17 | # detalhes. |
18 | 18 | #-------------------------------------------------------------------------- |
19 | +import sys | |
20 | + | |
19 | 21 | import Image |
20 | 22 | |
21 | 23 | import wx |
... | ... | @@ -34,7 +36,8 @@ class NotebookPanel(wx.Panel): |
34 | 36 | # TODO: check under Windows and Linux |
35 | 37 | # this was necessary under MacOS: |
36 | 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 | 42 | book.AddPage(MasksListCtrlPanel(book), "Masks") |
40 | 43 | book.AddPage(SurfacesListCtrlPanel(book), "Surfaces") |
... | ... | @@ -114,8 +117,9 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
114 | 117 | bitmap.SetWidth(16) |
115 | 118 | bitmap.SetHeight(16) |
116 | 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 | 124 | self.image_gray = Image.open("../icons/object_colour.jpg") |
121 | 125 | |
... | ... | @@ -240,7 +244,8 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
240 | 244 | bitmap.SetHeight(16) |
241 | 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 | 250 | self.image_gray = Image.open("../icons/object_colour.jpg") |
246 | 251 | |
... | ... | @@ -368,7 +373,8 @@ class MeasuresListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
368 | 373 | bitmap.SetHeight(16) |
369 | 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 | 379 | def OnItemActivated(self, evt): |
374 | 380 | self.ToggleItem(evt.m_itemIndex) |
... | ... | @@ -449,7 +455,8 @@ class AnnotationsListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
449 | 455 | bitmap.SetHeight(16) |
450 | 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 | 461 | def OnItemActivated(self, evt): |
455 | 462 | self.ToggleItem(evt.m_itemIndex) | ... | ... |
invesalius/gui/task_slice.py
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
18 | 18 | # detalhes. |
19 | 19 | #-------------------------------------------------------------------------- |
20 | +import sys | |
20 | 21 | |
21 | 22 | import wx |
22 | 23 | import wx.lib.colourselect as csel |
... | ... | @@ -105,7 +106,8 @@ class InnerTaskPanel(wx.Panel): |
105 | 106 | |
106 | 107 | # Button to fold to select region task |
107 | 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 | 111 | button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) |
110 | 112 | |
111 | 113 | # Add line sizers into main sizer |
... | ... | @@ -227,7 +229,8 @@ class MaskProperties(wx.Panel): |
227 | 229 | combo_mask_name = wx.ComboBox(self, -1, "", choices= MASK_LIST, |
228 | 230 | style=wx.CB_DROPDOWN|wx.CB_READONLY) |
229 | 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 | 234 | self.combo_mask_name = combo_mask_name |
232 | 235 | |
233 | 236 | # Mask colour |
... | ... | @@ -248,7 +251,8 @@ class MaskProperties(wx.Panel): |
248 | 251 | choices=[],#THRESHOLD_LIST |
249 | 252 | style=wx.CB_DROPDOWN|wx.CB_READONLY) |
250 | 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 | 256 | self.combo_thresh = combo_thresh |
253 | 257 | |
254 | 258 | ## LINE 4 |
... | ... | @@ -414,7 +418,8 @@ class EditionTools(wx.Panel): |
414 | 418 | choices = const.BRUSH_OP_NAME, |
415 | 419 | style = wx.CB_DROPDOWN|wx.CB_READONLY) |
416 | 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 | 423 | self.combo_brush_op = combo_brush_op |
419 | 424 | |
420 | 425 | # Sizer which represents the second line | ... | ... |
invesalius/gui/task_surface.py
... | ... | @@ -16,6 +16,8 @@ |
16 | 16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
17 | 17 | # detalhes. |
18 | 18 | #-------------------------------------------------------------------------- |
19 | +import sys | |
20 | + | |
19 | 21 | import wx |
20 | 22 | import wx.lib.colourselect as csel |
21 | 23 | import wx.lib.hyperlink as hl |
... | ... | @@ -98,7 +100,8 @@ class InnerTaskPanel(wx.Panel): |
98 | 100 | |
99 | 101 | # Button to fold to select region task |
100 | 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 | 105 | #button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) |
103 | 106 | |
104 | 107 | # Add line sizers into main sizer |
... | ... | @@ -168,7 +171,8 @@ class NewSurfaceDialog(wx.Dialog): |
168 | 171 | combo_surface_name = wx.ComboBox(self, -1, "", choices= MASK_LIST, |
169 | 172 | style=wx.CB_DROPDOWN|wx.CB_READONLY) |
170 | 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 | 176 | self.combo_surface_name = combo_surface_name |
173 | 177 | |
174 | 178 | |
... | ... | @@ -278,7 +282,8 @@ class SurfaceProperties(wx.Panel): |
278 | 282 | combo_surface_name = wx.ComboBox(self, -1, "", choices= SURFACE_LIST, |
279 | 283 | style=wx.CB_DROPDOWN|wx.CB_READONLY) |
280 | 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 | 287 | combo_surface_name.Bind(wx.EVT_COMBOBOX, self.OnComboName) |
283 | 288 | self.combo_surface_name = combo_surface_name |
284 | 289 | ... | ... |
invesalius/gui/widgets/gradient.py
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 | #-------------------------------------------------------------------------- |
22 | 22 | |
23 | 23 | import array |
24 | +import sys | |
24 | 25 | |
25 | 26 | import numpy |
26 | 27 | import vtk |
... | ... | @@ -506,13 +507,15 @@ class GradientSlider(wx.Panel): |
506 | 507 | self.SpinMin = wx.lib.intctrl.IntCtrl(self, size=(40,20)) |
507 | 508 | #self.SpinMin.SetLimited(True) |
508 | 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 | 512 | self.SpinMin.SetValue(self.SliderData.minRange) |
511 | 513 | |
512 | 514 | self.SpinMax = wx.lib.intctrl.IntCtrl(self, size=(40,20)) |
513 | 515 | #self.SpinMax.SetLimited(True) |
514 | 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 | 519 | self.SpinMax.SetValue(self.SliderData.maxRange) |
517 | 520 | |
518 | 521 | self.GradientPanel = GradientPanel(self, -1, self.SliderData) | ... | ... |