Commit 7b2c767a7799f85e09921f72c3bc22f8711533e9

Authored by tatiana
1 parent fac09b04

FIX: Forth try on toolbar size under linux and win

Showing 1 changed file with 31 additions and 7 deletions   Show diff stats
invesalius/gui/frame.py
... ... @@ -261,9 +261,10 @@ class ProjectToolBar(wx.ToolBar):
261 261 def __init__(self, parent):
262 262 wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER)
263 263 if sys.platform == 'darwin':
264   - self.SetToolBitmapSize(wx.Size(25,25))
  264 + self._size = 25
265 265 else:
266   - self.SetToolBitmapSize(wx.Size(16,16))
  266 + self._size = 16
  267 + self.SetToolBitmapSize(wx.Size(self._size,self._size))
267 268 self.parent = parent
268 269 self.__init_items()
269 270 self.__bind_events()
... ... @@ -274,7 +275,13 @@ class ProjectToolBar(wx.ToolBar):
274 275 BMP_EXPORT = wx.Bitmap("../icons/file_export.png", wx.BITMAP_TYPE_PNG)
275 276 BMP_NET = wx.Bitmap("../icons/file_from_internet.png", wx.BITMAP_TYPE_PNG)
276 277 BMP_SAVE = wx.Bitmap("../icons/file_save.png", wx.BITMAP_TYPE_PNG)
277   -
  278 +
  279 + if sys.platform != 'darwin':
  280 + bmp_list = [BMP_IMPORT, BMP_EXPORT, BMP_NET, BMP_SAVE]
  281 + for bmp in bmp_list:
  282 + bmp.SetWidth(self._size)
  283 + bmp.SetHeight(self._size)
  284 +
278 285 self.AddLabelTool(101, "Import medical image...", BMP_IMPORT)
279 286 self.AddLabelTool(101, "Export data.", BMP_EXPORT)
280 287 self.AddLabelTool(101, "Load medical image...", BMP_NET)
... ... @@ -290,9 +297,11 @@ class ObjectToolBar(wx.ToolBar):
290 297 def __init__(self, parent):
291 298 wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER)
292 299 if sys.platform == 'darwin':
293   - self.SetToolBitmapSize(wx.Size(25,25))
  300 + self._size = 25
294 301 else:
295   - self.SetToolBitmapSize(wx.Size(16,16))
  302 + self._size = 16
  303 + self.SetToolBitmapSize(wx.Size(self._size,self._size))
  304 +
296 305 self.parent = parent
297 306 self.__init_items()
298 307 self.__bind_events()
... ... @@ -305,6 +314,12 @@ class ObjectToolBar(wx.ToolBar):
305 314 BMP_PHOTO = wx.Bitmap("../icons/tool_photo.png", wx.BITMAP_TYPE_PNG)
306 315 BMP_PRINT = wx.Bitmap("../icons/tool_print.png", wx.BITMAP_TYPE_PNG)
307 316  
  317 + if sys.platform != 'darwin':
  318 + bmp_list = [BMP_ZOOM, BMP_PHOTO, BMP_PRINT]
  319 + for bmp in bmp_list:
  320 + bmp.SetWidth(self._size)
  321 + bmp.SetHeight(self._size)
  322 +
308 323 #self.AddLabelTool(101, "Rotate image", BMP_ROTATE)
309 324 #self.AddLabelTool(101, "Translate image", BMP_TRANSLATE)
310 325 self.AddLabelTool(101, "Zoom image", BMP_ZOOM)
... ... @@ -321,9 +336,11 @@ class LayoutToolBar(wx.ToolBar):
321 336 def __init__(self, parent):
322 337 wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER)
323 338 if sys.platform == 'darwin':
324   - self.SetToolBitmapSize(wx.Size(25,25))
  339 + self._size = 25
325 340 else:
326   - self.SetToolBitmapSize(wx.Size(16,16))
  341 + self._size = 16
  342 + self.SetToolBitmapSize(wx.Size(self._size,self._size))
  343 +
327 344 self.parent = parent
328 345 self.__init_items()
329 346 self.__bind_events()
... ... @@ -332,6 +349,13 @@ class LayoutToolBar(wx.ToolBar):
332 349  
333 350 BMP_ROTATE = wx.Bitmap("../icons/layout_data_only.png", wx.BITMAP_TYPE_PNG)
334 351 BMP_TRANSLATE = wx.Bitmap("../icons/layout_full.png", wx.BITMAP_TYPE_PNG)
  352 +
  353 + if sys.platform != 'darwin':
  354 + bmp_list = [BMP_ROTATE, BMP_TRANSLATE]
  355 + for bmp in bmp_list:
  356 + bmp.SetWidth(self._size)
  357 + bmp.SetHeight(self._size)
  358 +
335 359 #BMP_ZOOM = wx.Bitmap("../icons/tool_zoom.png", wx.BITMAP_TYPE_PNG)
336 360 #BMP_PHOTO = wx.Bitmap("../icons/tool_photo.png", wx.BITMAP_TYPE_PNG)
337 361 #BMP_PRINT = wx.Bitmap("../icons/tool_print.png", wx.BITMAP_TYPE_PNG)
... ...