Commit 3a3d1ea61ddcad16b359516ef1f1e90a669108e0

Authored by Thiago Franco de Moraes
1 parent 6f8a7155
Exists in wxgtk3_bkp

Fixed the problems with backgroundcolour from statictext in the taskbar

invesalius/gui/task_exporter.py
@@ -99,7 +99,8 @@ class InnerTaskPanel(wx.Panel): @@ -99,7 +99,8 @@ class InnerTaskPanel(wx.Panel):
99 99
100 def __init__(self, parent): 100 def __init__(self, parent):
101 wx.Panel.__init__(self, parent) 101 wx.Panel.__init__(self, parent)
102 - self.SetBackgroundColour(wx.Colour(255,255,255)) 102 + backgroud_colour = wx.Colour(255,255,255)
  103 + self.SetBackgroundColour(backgroud_colour)
103 self.SetAutoLayout(1) 104 self.SetAutoLayout(1)
104 105
105 # Counter for projects loaded in current GUI 106 # Counter for projects loaded in current GUI
@@ -109,7 +110,9 @@ class InnerTaskPanel(wx.Panel): @@ -109,7 +110,9 @@ class InnerTaskPanel(wx.Panel):
109 link_export_picture = hl.HyperLinkCtrl(self, -1, 110 link_export_picture = hl.HyperLinkCtrl(self, -1,
110 _("Export picture...")) 111 _("Export picture..."))
111 link_export_picture.SetUnderlines(False, False, False) 112 link_export_picture.SetUnderlines(False, False, False)
  113 + link_export_picture.SetBold(True)
112 link_export_picture.SetColours("BLACK", "BLACK", "BLACK") 114 link_export_picture.SetColours("BLACK", "BLACK", "BLACK")
  115 + link_export_picture.SetBackgroundColour(self.GetBackgroundColour())
113 link_export_picture.SetToolTip(tooltip) 116 link_export_picture.SetToolTip(tooltip)
114 link_export_picture.AutoBrowse(False) 117 link_export_picture.AutoBrowse(False)
115 link_export_picture.UpdateLink() 118 link_export_picture.UpdateLink()
@@ -119,7 +122,9 @@ class InnerTaskPanel(wx.Panel): @@ -119,7 +122,9 @@ class InnerTaskPanel(wx.Panel):
119 tooltip = wx.ToolTip(_("Export 3D surface")) 122 tooltip = wx.ToolTip(_("Export 3D surface"))
120 link_export_surface = hl.HyperLinkCtrl(self, -1,_("Export 3D surface...")) 123 link_export_surface = hl.HyperLinkCtrl(self, -1,_("Export 3D surface..."))
121 link_export_surface.SetUnderlines(False, False, False) 124 link_export_surface.SetUnderlines(False, False, False)
  125 + link_export_surface.SetBold(True)
122 link_export_surface.SetColours("BLACK", "BLACK", "BLACK") 126 link_export_surface.SetColours("BLACK", "BLACK", "BLACK")
  127 + link_export_surface.SetBackgroundColour(self.GetBackgroundColour())
123 link_export_surface.SetToolTip(tooltip) 128 link_export_surface.SetToolTip(tooltip)
124 link_export_surface.AutoBrowse(False) 129 link_export_surface.AutoBrowse(False)
125 link_export_surface.UpdateLink() 130 link_export_surface.UpdateLink()
@@ -189,11 +194,13 @@ class InnerTaskPanel(wx.Panel): @@ -189,11 +194,13 @@ class InnerTaskPanel(wx.Panel):
189 button_picture = pbtn.PlateButton(self, BTN_PICTURE, "", 194 button_picture = pbtn.PlateButton(self, BTN_PICTURE, "",
190 BMP_TAKE_PICTURE, 195 BMP_TAKE_PICTURE,
191 style=button_style) 196 style=button_style)
  197 + button_picture.SetBackgroundColour(self.GetBackgroundColour())
192 self.button_picture = button_picture 198 self.button_picture = button_picture
193 199
194 button_surface = pbtn.PlateButton(self, BTN_SURFACE, "", 200 button_surface = pbtn.PlateButton(self, BTN_SURFACE, "",
195 BMP_EXPORT_SURFACE, 201 BMP_EXPORT_SURFACE,
196 style=button_style) 202 style=button_style)
  203 + button_surface.SetBackgroundColour(self.GetBackgroundColour())
197 #button_mask = pbtn.PlateButton(self, BTN_MASK, "", 204 #button_mask = pbtn.PlateButton(self, BTN_MASK, "",
198 # BMP_EXPORT_MASK, 205 # BMP_EXPORT_MASK,
199 # style=button_style) 206 # style=button_style)
invesalius/gui/task_importer.py
@@ -51,7 +51,10 @@ class TaskPanel(wx.Panel): @@ -51,7 +51,10 @@ class TaskPanel(wx.Panel):
51 class InnerTaskPanel(wx.Panel): 51 class InnerTaskPanel(wx.Panel):
52 def __init__(self, parent): 52 def __init__(self, parent):
53 wx.Panel.__init__(self, parent) 53 wx.Panel.__init__(self, parent)
54 - self.SetBackgroundColour(wx.Colour(255,255,255)) 54 +
  55 + backgroud_colour = wx.Colour(255,255,255)
  56 +
  57 + self.SetBackgroundColour(backgroud_colour)
55 self.SetAutoLayout(1) 58 self.SetAutoLayout(1)
56 59
57 # Counter for projects loaded in current GUI 60 # Counter for projects loaded in current GUI
@@ -64,7 +67,9 @@ class InnerTaskPanel(wx.Panel): @@ -64,7 +67,9 @@ class InnerTaskPanel(wx.Panel):
64 tooltip = wx.ToolTip(_("Select DICOM or Analyze files to be reconstructed")) 67 tooltip = wx.ToolTip(_("Select DICOM or Analyze files to be reconstructed"))
65 link_import_local = hl.HyperLinkCtrl(self, -1, _("Import medical images...")) 68 link_import_local = hl.HyperLinkCtrl(self, -1, _("Import medical images..."))
66 link_import_local.SetUnderlines(False, False, False) 69 link_import_local.SetUnderlines(False, False, False)
  70 + link_import_local.SetBold(True)
67 link_import_local.SetColours("BLACK", "BLACK", "BLACK") 71 link_import_local.SetColours("BLACK", "BLACK", "BLACK")
  72 + link_import_local.SetBackgroundColour(backgroud_colour)
68 link_import_local.SetToolTip(tooltip) 73 link_import_local.SetToolTip(tooltip)
69 link_import_local.AutoBrowse(False) 74 link_import_local.AutoBrowse(False)
70 link_import_local.UpdateLink() 75 link_import_local.UpdateLink()
@@ -82,7 +87,9 @@ class InnerTaskPanel(wx.Panel): @@ -82,7 +87,9 @@ class InnerTaskPanel(wx.Panel):
82 tooltip = wx.ToolTip(_("Open an existing InVesalius project...")) 87 tooltip = wx.ToolTip(_("Open an existing InVesalius project..."))
83 link_open_proj = hl.HyperLinkCtrl(self,-1,_("Open an existing project...")) 88 link_open_proj = hl.HyperLinkCtrl(self,-1,_("Open an existing project..."))
84 link_open_proj.SetUnderlines(False, False, False) 89 link_open_proj.SetUnderlines(False, False, False)
  90 + link_open_proj.SetBold(True)
85 link_open_proj.SetColours("BLACK", "BLACK", "BLACK") 91 link_open_proj.SetColours("BLACK", "BLACK", "BLACK")
  92 + link_open_proj.SetBackgroundColour(backgroud_colour)
86 link_open_proj.SetToolTip(tooltip) 93 link_open_proj.SetToolTip(tooltip)
87 link_open_proj.AutoBrowse(False) 94 link_open_proj.AutoBrowse(False)
88 link_open_proj.UpdateLink() 95 link_open_proj.UpdateLink()
@@ -105,8 +112,10 @@ class InnerTaskPanel(wx.Panel): @@ -105,8 +112,10 @@ class InnerTaskPanel(wx.Panel):
105 # style=button_style) 112 # style=button_style)
106 button_import_local = pbtn.PlateButton(self, BTN_IMPORT_LOCAL, "", 113 button_import_local = pbtn.PlateButton(self, BTN_IMPORT_LOCAL, "",
107 BMP_IMPORT, style=button_style) 114 BMP_IMPORT, style=button_style)
  115 + button_import_local.SetBackgroundColour(self.GetBackgroundColour())
108 button_open_proj = pbtn.PlateButton(self, BTN_OPEN_PROJECT, "", 116 button_open_proj = pbtn.PlateButton(self, BTN_OPEN_PROJECT, "",
109 BMP_OPEN_PROJECT, style=button_style) 117 BMP_OPEN_PROJECT, style=button_style)
  118 + button_open_proj.SetBackgroundColour(self.GetBackgroundColour())
110 119
111 # When using PlaneButton, it is necessary to bind events from parent win 120 # When using PlaneButton, it is necessary to bind events from parent win
112 self.Bind(wx.EVT_BUTTON, self.OnButton) 121 self.Bind(wx.EVT_BUTTON, self.OnButton)
@@ -185,6 +194,7 @@ class InnerTaskPanel(wx.Panel): @@ -185,6 +194,7 @@ class InnerTaskPanel(wx.Panel):
185 proj_link = hl.HyperLinkCtrl(self, -1, label) 194 proj_link = hl.HyperLinkCtrl(self, -1, label)
186 proj_link.SetUnderlines(False, False, False) 195 proj_link.SetUnderlines(False, False, False)
187 proj_link.SetColours("BLACK", "BLACK", "BLACK") 196 proj_link.SetColours("BLACK", "BLACK", "BLACK")
  197 + proj_link.SetBackgroundColour(self.GetBackgroundColour())
188 proj_link.AutoBrowse(False) 198 proj_link.AutoBrowse(False)
189 proj_link.UpdateLink() 199 proj_link.UpdateLink()
190 proj_link.Bind(hl.EVT_HYPERLINK_LEFT, 200 proj_link.Bind(hl.EVT_HYPERLINK_LEFT,
@@ -201,7 +211,7 @@ class InnerTaskPanel(wx.Panel): @@ -201,7 +211,7 @@ class InnerTaskPanel(wx.Panel):
201 def OnLinkImport(self, event): 211 def OnLinkImport(self, event):
202 self.ImportDicom() 212 self.ImportDicom()
203 event.Skip() 213 event.Skip()
204 - 214 +
205 def OnLinkImportPACS(self, event): 215 def OnLinkImportPACS(self, event):
206 self.ImportPACS() 216 self.ImportPACS()
207 event.Skip() 217 event.Skip()
@@ -210,7 +220,7 @@ class InnerTaskPanel(wx.Panel): @@ -210,7 +220,7 @@ class InnerTaskPanel(wx.Panel):
210 self.OpenProject() 220 self.OpenProject()
211 event.Skip() 221 event.Skip()
212 222
213 - 223 +
214 def ImportPACS(self): 224 def ImportPACS(self):
215 print "TODO: Send Signal - Import DICOM files from PACS" 225 print "TODO: Send Signal - Import DICOM files from PACS"
216 226
invesalius/gui/task_slice.py
@@ -65,7 +65,8 @@ class TaskPanel(wx.Panel): @@ -65,7 +65,8 @@ class TaskPanel(wx.Panel):
65 class InnerTaskPanel(wx.Panel): 65 class InnerTaskPanel(wx.Panel):
66 def __init__(self, parent): 66 def __init__(self, parent):
67 wx.Panel.__init__(self, parent) 67 wx.Panel.__init__(self, parent)
68 - self.SetBackgroundColour(wx.Colour(255,255,255)) 68 + backgroud_colour = wx.Colour(255,255,255)
  69 + self.SetBackgroundColour(backgroud_colour)
69 self.SetAutoLayout(1) 70 self.SetAutoLayout(1)
70 71
71 # Image(s) for buttons 72 # Image(s) for buttons
@@ -76,6 +77,7 @@ class InnerTaskPanel(wx.Panel): @@ -76,6 +77,7 @@ class InnerTaskPanel(wx.Panel):
76 # Button for creating new surface 77 # Button for creating new surface
77 button_new_mask = pbtn.PlateButton(self, BTN_NEW, "", BMP_ADD, style=\ 78 button_new_mask = pbtn.PlateButton(self, BTN_NEW, "", BMP_ADD, style=\
78 pbtn.PB_STYLE_SQUARE | pbtn.PB_STYLE_DEFAULT) 79 pbtn.PB_STYLE_SQUARE | pbtn.PB_STYLE_DEFAULT)
  80 + button_new_mask.SetBackgroundColour(self.GetBackgroundColour())
79 self.Bind(wx.EVT_BUTTON, self.OnButton) 81 self.Bind(wx.EVT_BUTTON, self.OnButton)
80 82
81 83
@@ -83,7 +85,9 @@ class InnerTaskPanel(wx.Panel): @@ -83,7 +85,9 @@ class InnerTaskPanel(wx.Panel):
83 tooltip = wx.ToolTip(_("Create mask for slice segmentation and editing")) 85 tooltip = wx.ToolTip(_("Create mask for slice segmentation and editing"))
84 link_new_mask = hl.HyperLinkCtrl(self, -1, _("Create new mask")) 86 link_new_mask = hl.HyperLinkCtrl(self, -1, _("Create new mask"))
85 link_new_mask.SetUnderlines(False, False, False) 87 link_new_mask.SetUnderlines(False, False, False)
  88 + link_new_mask.SetBold(True)
86 link_new_mask.SetColours("BLACK", "BLACK", "BLACK") 89 link_new_mask.SetColours("BLACK", "BLACK", "BLACK")
  90 + link_new_mask.SetBackgroundColour(self.GetBackgroundColour())
87 link_new_mask.SetToolTip(tooltip) 91 link_new_mask.SetToolTip(tooltip)
88 link_new_mask.AutoBrowse(False) 92 link_new_mask.AutoBrowse(False)
89 link_new_mask.UpdateLink() 93 link_new_mask.UpdateLink()
@@ -201,7 +205,6 @@ class InnerTaskPanel(wx.Panel): @@ -201,7 +205,6 @@ class InnerTaskPanel(wx.Panel):
201 class FoldPanel(wx.Panel): 205 class FoldPanel(wx.Panel):
202 def __init__(self, parent): 206 def __init__(self, parent):
203 wx.Panel.__init__(self, parent) 207 wx.Panel.__init__(self, parent)
204 - self.SetBackgroundColour(wx.Colour(0,255,0))  
205 208
206 inner_panel = InnerFoldPanel(self) 209 inner_panel = InnerFoldPanel(self)
207 210
@@ -223,8 +226,7 @@ class InnerFoldPanel(wx.Panel): @@ -223,8 +226,7 @@ class InnerFoldPanel(wx.Panel):
223 def __init__(self, parent): 226 def __init__(self, parent):
224 wx.Panel.__init__(self, parent) 227 wx.Panel.__init__(self, parent)
225 default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR) 228 default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR)
226 - #self.SetBackgroundColour(default_colour)  
227 - self.SetBackgroundColour((255, 0, 0)) 229 + self.SetBackgroundColour(default_colour)
228 230
229 # Fold panel and its style settings 231 # Fold panel and its style settings
230 # FIXME: If we dont insert a value in size or if we set wx.DefaultSize, 232 # FIXME: If we dont insert a value in size or if we set wx.DefaultSize,
invesalius/gui/task_surface.py
@@ -68,8 +68,8 @@ class InnerTaskPanel(wx.Panel): @@ -68,8 +68,8 @@ class InnerTaskPanel(wx.Panel):
68 def __init__(self, parent): 68 def __init__(self, parent):
69 wx.Panel.__init__(self, parent) 69 wx.Panel.__init__(self, parent)
70 default_colour = self.GetBackgroundColour() 70 default_colour = self.GetBackgroundColour()
71 - #self.SetBackgroundColour(wx.Colour(255,255,255))  
72 - self.SetBackgroundColour(wx.Colour(0,0,255)) 71 + backgroud_colour = wx.Colour(255,255,255)
  72 + self.SetBackgroundColour(backgroud_colour)
73 self.SetAutoLayout(1) 73 self.SetAutoLayout(1)
74 74
75 75
@@ -80,13 +80,16 @@ class InnerTaskPanel(wx.Panel): @@ -80,13 +80,16 @@ class InnerTaskPanel(wx.Panel):
80 # Button for creating new surface 80 # Button for creating new surface
81 button_new_surface = pbtn.PlateButton(self, BTN_NEW, "", BMP_ADD, style=\ 81 button_new_surface = pbtn.PlateButton(self, BTN_NEW, "", BMP_ADD, style=\
82 pbtn.PB_STYLE_SQUARE | pbtn.PB_STYLE_DEFAULT) 82 pbtn.PB_STYLE_SQUARE | pbtn.PB_STYLE_DEFAULT)
  83 + button_new_surface.SetBackgroundColour(self.GetBackgroundColour())
83 self.Bind(wx.EVT_BUTTON, self.OnButton) 84 self.Bind(wx.EVT_BUTTON, self.OnButton)
84 85
85 # Fixed hyperlink items 86 # Fixed hyperlink items
86 tooltip = wx.ToolTip(_("Create 3D surface based on a mask")) 87 tooltip = wx.ToolTip(_("Create 3D surface based on a mask"))
87 link_new_surface = hl.HyperLinkCtrl(self, -1, _("Create new 3D surface")) 88 link_new_surface = hl.HyperLinkCtrl(self, -1, _("Create new 3D surface"))
88 link_new_surface.SetUnderlines(False, False, False) 89 link_new_surface.SetUnderlines(False, False, False)
  90 + link_new_surface.SetBold(True)
89 link_new_surface.SetColours("BLACK", "BLACK", "BLACK") 91 link_new_surface.SetColours("BLACK", "BLACK", "BLACK")
  92 + link_new_surface.SetBackgroundColour(self.GetBackgroundColour())
90 link_new_surface.SetToolTip(tooltip) 93 link_new_surface.SetToolTip(tooltip)
91 link_new_surface.AutoBrowse(False) 94 link_new_surface.AutoBrowse(False)
92 link_new_surface.UpdateLink() 95 link_new_surface.UpdateLink()
@@ -177,7 +180,6 @@ class InnerTaskPanel(wx.Panel): @@ -177,7 +180,6 @@ class InnerTaskPanel(wx.Panel):
177 class FoldPanel(wx.Panel): 180 class FoldPanel(wx.Panel):
178 def __init__(self, parent): 181 def __init__(self, parent):
179 wx.Panel.__init__(self, parent, size=(50,700)) 182 wx.Panel.__init__(self, parent, size=(50,700))
180 - self.SetBackgroundColour(wx.Colour(0,255,0))  
181 183
182 inner_panel = InnerFoldPanel(self) 184 inner_panel = InnerFoldPanel(self)
183 185
@@ -262,8 +264,7 @@ class SurfaceTools(wx.Panel): @@ -262,8 +264,7 @@ class SurfaceTools(wx.Panel):
262 def __init__(self, parent): 264 def __init__(self, parent):
263 wx.Panel.__init__(self, parent) 265 wx.Panel.__init__(self, parent)
264 default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR) 266 default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR)
265 - #self.SetBackgroundColour(default_colour)  
266 - self.SetBackgroundColour((0, 255, 0)) 267 + self.SetBackgroundColour(default_colour)
267 268
268 #self.SetBackgroundColour(wx.Colour(255,255,255)) 269 #self.SetBackgroundColour(wx.Colour(255,255,255))
269 self.SetAutoLayout(1) 270 self.SetAutoLayout(1)
@@ -397,8 +398,7 @@ class SurfaceProperties(wx.Panel): @@ -397,8 +398,7 @@ class SurfaceProperties(wx.Panel):
397 def __init__(self, parent): 398 def __init__(self, parent):
398 wx.Panel.__init__(self, parent) 399 wx.Panel.__init__(self, parent)
399 default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR) 400 default_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUBAR)
400 - #self.SetBackgroundColour(default_colour)  
401 - self.SetBackgroundColour((255, 0, 0)) 401 + self.SetBackgroundColour(default_colour)
402 402
403 self.surface_dict = utl.TwoWaysDictionary() 403 self.surface_dict = utl.TwoWaysDictionary()
404 404
@@ -458,7 +458,7 @@ class SurfaceProperties(wx.Panel): @@ -458,7 +458,7 @@ class SurfaceProperties(wx.Panel):
458 #sizer.Add(cb, 0, wx.GROW|wx.EXPAND|wx.RIGHT|wx.LEFT|wx.TOP|wx.BOTTOM, 5) 458 #sizer.Add(cb, 0, wx.GROW|wx.EXPAND|wx.RIGHT|wx.LEFT|wx.TOP|wx.BOTTOM, 5)
459 sizer.Fit(self) 459 sizer.Fit(self)
460 460
461 - self.SetSizer(sizer) 461 + self.SetSizerAndFit(sizer)
462 self.Update() 462 self.Update()
463 #self.SetAutoLayout(1) 463 #self.SetAutoLayout(1)
464 464