1466 def addSideWidget(self, side, widget, icon, label): |
1472 def addSideWidget(self, side, widget, icon, label): |
1467 """ |
1473 """ |
1468 Public method to add a widget to the sides. |
1474 Public method to add a widget to the sides. |
1469 |
1475 |
1470 @param side side to add the widget to |
1476 @param side side to add the widget to |
1471 @type int (one of UserInterface.LeftSide, UserInterface.BottomSide, |
1477 @type UserInterfaceSide |
1472 UserInterface.RightSide) |
|
1473 @param widget reference to the widget to add |
1478 @param widget reference to the widget to add |
1474 @type QWidget |
1479 @type QWidget |
1475 @param icon icon to be used |
1480 @param icon icon to be used |
1476 @type QIcon |
1481 @type QIcon |
1477 @param label label text to be shown |
1482 @param label label text to be shown |
1478 @type str |
1483 @type str |
1479 """ |
1484 """ |
1480 if side in [ |
1485 if self.__layoutType == "Toolboxes": |
1481 UserInterface.LeftSide, |
1486 if side == UserInterfaceSide.Left: |
1482 UserInterface.BottomSide, |
1487 self.lToolbox.addItem(widget, icon, label) |
1483 UserInterface.RightSide, |
1488 elif side == UserInterfaceSide.Bottom: |
1484 ]: |
1489 self.hToolbox.addItem(widget, icon, label) |
1485 if self.__layoutType == "Toolboxes": |
1490 elif side == UserInterfaceSide.Right: |
1486 if side == UserInterface.LeftSide: |
1491 self.rToolbox.addItem(widget, icon, label) |
1487 self.lToolbox.addItem(widget, icon, label) |
1492 elif self.__layoutType == "Sidebars": |
1488 elif side == UserInterface.BottomSide: |
1493 if side == UserInterfaceSide.Left: |
1489 self.hToolbox.addItem(widget, icon, label) |
1494 self.leftSidebar.addTab(widget, icon, label) |
1490 elif side == UserInterface.RightSide: |
1495 elif side == UserInterfaceSide.Bottom: |
1491 self.rToolbox.addItem(widget, icon, label) |
1496 self.bottomSidebar.addTab(widget, icon, label) |
1492 elif self.__layoutType == "Sidebars": |
1497 elif side == UserInterfaceSide.Right: |
1493 if side == UserInterface.LeftSide: |
1498 if self.rightSidebar: |
|
1499 self.rightSidebar.addTab(widget, icon, label) |
|
1500 else: |
1494 self.leftSidebar.addTab(widget, icon, label) |
1501 self.leftSidebar.addTab(widget, icon, label) |
1495 elif side == UserInterface.BottomSide: |
|
1496 self.bottomSidebar.addTab(widget, icon, label) |
|
1497 elif side == UserInterface.RightSide: |
|
1498 if self.rightSidebar: |
|
1499 self.rightSidebar.addTab(widget, icon, label) |
|
1500 else: |
|
1501 self.leftSidebar.addTab(widget, icon, label) |
|
1502 |
1502 |
1503 def removeSideWidget(self, widget): |
1503 def removeSideWidget(self, widget): |
1504 """ |
1504 """ |
1505 Public method to remove a widget added using addSideWidget(). |
1505 Public method to remove a widget added using addSideWidget(). |
1506 |
1506 |