Commit 2d61ccf40466d120611589fd87c04cebbeecfbe9

Authored by tfmoraes
1 parent 7c36fe2f

FIX: The icons in selection surface wasn't appearing in Linux. Related to #229

Showing 1 changed file with 26 additions and 20 deletions   Show diff stats
invesalius/gui/task_surface.py
... ... @@ -271,25 +271,32 @@ class SurfaceTools(wx.Panel):
271 271 link_seeds.Bind(hl.EVT_HYPERLINK_LEFT, self.OnLinkSeed)
272 272  
273 273 # Image(s) for buttons
274   - BMP_LARGEST = wx.Bitmap("../icons/connectivity_largest.png", wx.BITMAP_TYPE_PNG)
275   - BMP_SPLIT_ALL = wx.Bitmap("../icons/connectivity_split_all.png", wx.BITMAP_TYPE_PNG)
276   - BMP_SEEDS = wx.Bitmap("../icons/connectivity_manual.png", wx.BITMAP_TYPE_PNG)
  274 + img_largest = wx.Image("../icons/connectivity_largest.png",
  275 + wx.BITMAP_TYPE_PNG)
  276 + img_largest.Rescale(25, 25)
  277 + bmp_largest = img_largest.ConvertToBitmap()
277 278  
278   - bmp_list = [BMP_LARGEST, BMP_SPLIT_ALL, BMP_SEEDS]
279   - for bmp in bmp_list:
280   - bmp.SetWidth(25)
281   - bmp.SetHeight(25)
  279 + img_split_all = wx.Image("../icons/connectivity_split_all.png",
  280 + wx.BITMAP_TYPE_PNG)
  281 + img_split_all.Rescale(25, 25)
  282 + bmp_split_all = img_split_all.ConvertToBitmap()
  283 +
  284 + img_seeds = wx.Image("../icons/connectivity_manual.png",
  285 + wx.BITMAP_TYPE_PNG)
  286 + img_seeds.Rescale(25, 25)
  287 + bmp_seeds = img_seeds.ConvertToBitmap()
282 288  
283 289 # Buttons related to hyperlinks
284 290 button_style = pbtn.PB_STYLE_SQUARE | pbtn.PB_STYLE_DEFAULT
285 291 button_style_plus = button_style|pbtn.PB_STYLE_TOGGLE
286 292  
287   - button_split = pbtn.PlateButton(self, BTN_SPLIT, "", BMP_SPLIT_ALL,
288   - style=button_style)
289   - button_largest = pbtn.PlateButton(self, BTN_LARGEST, "",
290   - BMP_LARGEST, style=button_style)
291   - button_seeds = pbtn.PlateButton(self, BTN_SEEDS, "",
292   - BMP_SEEDS, style=button_style_plus)
  293 + button_split = pbtn.PlateButton(self, BTN_SPLIT, "", bmp_split_all,
  294 + style=button_style)
  295 + button_largest = pbtn.PlateButton(self, BTN_LARGEST, "", bmp_largest,
  296 + style=button_style)
  297 + button_seeds = pbtn.PlateButton(self, BTN_SEEDS, "", bmp_seeds,
  298 + style=button_style_plus)
  299 +
293 300 self.button_seeds = button_seeds
294 301  
295 302 # When using PlaneButton, it is necessary to bind events from parent win
... ... @@ -302,13 +309,12 @@ class SurfaceTools(wx.Panel):
302 309 #fixed_sizer = wx.FlexGridSizer(rows=3, cols=2, hgap=2, vgap=0)
303 310 fixed_sizer = wx.FlexGridSizer(rows=3, cols=2, hgap=2, vgap=0)
304 311 fixed_sizer.AddGrowableCol(0, 1)
305   - fixed_sizer.AddMany([ (link_largest, 1, flag_link, 3),
306   - (button_largest, 0, flag_button),
307   - (link_seeds, 1, flag_link, 3),
308   - (button_seeds, 0, flag_button),
309   - (link_split_all, 1, flag_link, 3),
310   - (button_split, 0, flag_button) ])
311   -
  312 + fixed_sizer.AddMany([(link_largest, 1, flag_link, 3),
  313 + (button_largest, 0, flag_button),
  314 + (link_seeds, 1, flag_link, 3),
  315 + (button_seeds, 0, flag_button),
  316 + (link_split_all, 1, flag_link, 3),
  317 + (button_split, 0, flag_button)])
312 318  
313 319 # Add line sizers into main sizer
314 320 main_sizer = wx.BoxSizer(wx.VERTICAL)
... ...