Commit 7b2c767a7799f85e09921f72c3bc22f8711533e9
1 parent
fac09b04
Exists in
master
and in
68 other branches
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,9 +261,10 @@ class ProjectToolBar(wx.ToolBar): | ||
| 261 | def __init__(self, parent): | 261 | def __init__(self, parent): |
| 262 | wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER) | 262 | wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER) |
| 263 | if sys.platform == 'darwin': | 263 | if sys.platform == 'darwin': |
| 264 | - self.SetToolBitmapSize(wx.Size(25,25)) | 264 | + self._size = 25 |
| 265 | else: | 265 | else: |
| 266 | - self.SetToolBitmapSize(wx.Size(16,16)) | 266 | + self._size = 16 |
| 267 | + self.SetToolBitmapSize(wx.Size(self._size,self._size)) | ||
| 267 | self.parent = parent | 268 | self.parent = parent |
| 268 | self.__init_items() | 269 | self.__init_items() |
| 269 | self.__bind_events() | 270 | self.__bind_events() |
| @@ -274,7 +275,13 @@ class ProjectToolBar(wx.ToolBar): | @@ -274,7 +275,13 @@ class ProjectToolBar(wx.ToolBar): | ||
| 274 | BMP_EXPORT = wx.Bitmap("../icons/file_export.png", wx.BITMAP_TYPE_PNG) | 275 | BMP_EXPORT = wx.Bitmap("../icons/file_export.png", wx.BITMAP_TYPE_PNG) |
| 275 | BMP_NET = wx.Bitmap("../icons/file_from_internet.png", wx.BITMAP_TYPE_PNG) | 276 | BMP_NET = wx.Bitmap("../icons/file_from_internet.png", wx.BITMAP_TYPE_PNG) |
| 276 | BMP_SAVE = wx.Bitmap("../icons/file_save.png", wx.BITMAP_TYPE_PNG) | 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 | self.AddLabelTool(101, "Import medical image...", BMP_IMPORT) | 285 | self.AddLabelTool(101, "Import medical image...", BMP_IMPORT) |
| 279 | self.AddLabelTool(101, "Export data.", BMP_EXPORT) | 286 | self.AddLabelTool(101, "Export data.", BMP_EXPORT) |
| 280 | self.AddLabelTool(101, "Load medical image...", BMP_NET) | 287 | self.AddLabelTool(101, "Load medical image...", BMP_NET) |
| @@ -290,9 +297,11 @@ class ObjectToolBar(wx.ToolBar): | @@ -290,9 +297,11 @@ class ObjectToolBar(wx.ToolBar): | ||
| 290 | def __init__(self, parent): | 297 | def __init__(self, parent): |
| 291 | wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER) | 298 | wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER) |
| 292 | if sys.platform == 'darwin': | 299 | if sys.platform == 'darwin': |
| 293 | - self.SetToolBitmapSize(wx.Size(25,25)) | 300 | + self._size = 25 |
| 294 | else: | 301 | else: |
| 295 | - self.SetToolBitmapSize(wx.Size(16,16)) | 302 | + self._size = 16 |
| 303 | + self.SetToolBitmapSize(wx.Size(self._size,self._size)) | ||
| 304 | + | ||
| 296 | self.parent = parent | 305 | self.parent = parent |
| 297 | self.__init_items() | 306 | self.__init_items() |
| 298 | self.__bind_events() | 307 | self.__bind_events() |
| @@ -305,6 +314,12 @@ class ObjectToolBar(wx.ToolBar): | @@ -305,6 +314,12 @@ class ObjectToolBar(wx.ToolBar): | ||
| 305 | BMP_PHOTO = wx.Bitmap("../icons/tool_photo.png", wx.BITMAP_TYPE_PNG) | 314 | BMP_PHOTO = wx.Bitmap("../icons/tool_photo.png", wx.BITMAP_TYPE_PNG) |
| 306 | BMP_PRINT = wx.Bitmap("../icons/tool_print.png", wx.BITMAP_TYPE_PNG) | 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 | #self.AddLabelTool(101, "Rotate image", BMP_ROTATE) | 323 | #self.AddLabelTool(101, "Rotate image", BMP_ROTATE) |
| 309 | #self.AddLabelTool(101, "Translate image", BMP_TRANSLATE) | 324 | #self.AddLabelTool(101, "Translate image", BMP_TRANSLATE) |
| 310 | self.AddLabelTool(101, "Zoom image", BMP_ZOOM) | 325 | self.AddLabelTool(101, "Zoom image", BMP_ZOOM) |
| @@ -321,9 +336,11 @@ class LayoutToolBar(wx.ToolBar): | @@ -321,9 +336,11 @@ class LayoutToolBar(wx.ToolBar): | ||
| 321 | def __init__(self, parent): | 336 | def __init__(self, parent): |
| 322 | wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER) | 337 | wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER) |
| 323 | if sys.platform == 'darwin': | 338 | if sys.platform == 'darwin': |
| 324 | - self.SetToolBitmapSize(wx.Size(25,25)) | 339 | + self._size = 25 |
| 325 | else: | 340 | else: |
| 326 | - self.SetToolBitmapSize(wx.Size(16,16)) | 341 | + self._size = 16 |
| 342 | + self.SetToolBitmapSize(wx.Size(self._size,self._size)) | ||
| 343 | + | ||
| 327 | self.parent = parent | 344 | self.parent = parent |
| 328 | self.__init_items() | 345 | self.__init_items() |
| 329 | self.__bind_events() | 346 | self.__bind_events() |
| @@ -332,6 +349,13 @@ class LayoutToolBar(wx.ToolBar): | @@ -332,6 +349,13 @@ class LayoutToolBar(wx.ToolBar): | ||
| 332 | 349 | ||
| 333 | BMP_ROTATE = wx.Bitmap("../icons/layout_data_only.png", wx.BITMAP_TYPE_PNG) | 350 | BMP_ROTATE = wx.Bitmap("../icons/layout_data_only.png", wx.BITMAP_TYPE_PNG) |
| 334 | BMP_TRANSLATE = wx.Bitmap("../icons/layout_full.png", wx.BITMAP_TYPE_PNG) | 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 | #BMP_ZOOM = wx.Bitmap("../icons/tool_zoom.png", wx.BITMAP_TYPE_PNG) | 359 | #BMP_ZOOM = wx.Bitmap("../icons/tool_zoom.png", wx.BITMAP_TYPE_PNG) |
| 336 | #BMP_PHOTO = wx.Bitmap("../icons/tool_photo.png", wx.BITMAP_TYPE_PNG) | 360 | #BMP_PHOTO = wx.Bitmap("../icons/tool_photo.png", wx.BITMAP_TYPE_PNG) |
| 337 | #BMP_PRINT = wx.Bitmap("../icons/tool_print.png", wx.BITMAP_TYPE_PNG) | 361 | #BMP_PRINT = wx.Bitmap("../icons/tool_print.png", wx.BITMAP_TYPE_PNG) |