559 def createStatusBarIcon(self): |
559 def createStatusBarIcon(self): |
560 """ |
560 """ |
561 Public method to create a status bar icon. |
561 Public method to create a status bar icon. |
562 |
562 |
563 @return generated icon |
563 @return generated icon |
564 @rtype E5ClickableLabel |
564 @rtype EricClickableLabel |
565 """ |
565 """ |
566 icon = E5ClickableLabel() |
566 icon = EricClickableLabel() |
567 icon.setPixmap( |
567 icon.setPixmap( |
568 UI.PixmapCache.getPixmap("tabManager").scaled(16, 16)) |
568 UI.PixmapCache.getPixmap("tabManager").scaled(16, 16)) |
569 icon.setToolTip(self.tr("Show Tab Manager")) |
569 icon.setToolTip(self.tr("Show Tab Manager")) |
570 icon.clicked.connect(lambda: self.raiseTabManager(icon)) |
570 icon.clicked.connect(lambda: self.raiseTabManager(icon)) |
571 |
571 |
574 def raiseTabManager(self, icon): |
574 def raiseTabManager(self, icon): |
575 """ |
575 """ |
576 Public slot to show the tab manager. |
576 Public slot to show the tab manager. |
577 |
577 |
578 @param icon reference to the clicked icon |
578 @param icon reference to the clicked icon |
579 @type E5ClickableLabel or QAction |
579 @type EricClickableLabel or QAction |
580 """ |
580 """ |
581 window = None |
581 window = None |
582 if isinstance(icon, E5ClickableLabel): |
582 if isinstance(icon, EricClickableLabel): |
583 window = icon.window() |
583 window = icon.window() |
584 elif isinstance(icon, QAction): |
584 elif isinstance(icon, QAction): |
585 window = icon.parentWidget() |
585 window = icon.parentWidget() |
586 |
586 |
587 if window is not None: |
587 if window is not None: |
588 titleBarHeight = self.style().pixelMetric( |
588 titleBarHeight = self.style().pixelMetric( |
589 QStyle.PixelMetric.PM_TitleBarHeight) |
589 QStyle.PixelMetric.PM_TitleBarHeight) |
590 |
590 |
591 y = max(0, window.frameGeometry().top() + titleBarHeight + 1) |
591 y = max(0, window.frameGeometry().top() + titleBarHeight + 1) |
592 |
592 |
593 desktop = e5App().desktop() |
593 desktop = ericApp().desktop() |
594 desktopGeometry = desktop.availableGeometry(self) |
594 desktopGeometry = desktop.availableGeometry(self) |
595 windowFrameGeometry = window.frameGeometry() |
595 windowFrameGeometry = window.frameGeometry() |
596 if (desktopGeometry.width() - windowFrameGeometry.right() - 1 > |
596 if (desktopGeometry.width() - windowFrameGeometry.right() - 1 > |
597 self.frameGeometry().width()): |
597 self.frameGeometry().width()): |
598 x = windowFrameGeometry.right() + 1 |
598 x = windowFrameGeometry.right() + 1 |