578 """ |
578 """ |
579 window = None |
579 window = None |
580 if isinstance(icon, EricClickableLabel): |
580 if isinstance(icon, EricClickableLabel): |
581 window = icon.window() |
581 window = icon.window() |
582 elif isinstance(icon, QAction): |
582 elif isinstance(icon, QAction): |
583 window = icon.parentWidget() |
583 window = icon.parent() |
584 |
584 |
585 if window is not None: |
585 if window is not None: |
586 titleBarHeight = self.style().pixelMetric( |
586 titleBarHeight = self.style().pixelMetric( |
587 QStyle.PixelMetric.PM_TitleBarHeight) |
587 QStyle.PixelMetric.PM_TitleBarHeight) |
588 |
588 |
589 y = max(0, window.frameGeometry().top() + titleBarHeight + 1) |
589 y = max(0, window.frameGeometry().top() + titleBarHeight + 1) |
590 |
590 |
591 desktop = ericApp().desktop() |
591 availableGeometry = ericApp().primaryScreen().availableGeometry() |
592 desktopGeometry = desktop.availableGeometry(self) |
|
593 windowFrameGeometry = window.frameGeometry() |
592 windowFrameGeometry = window.frameGeometry() |
594 if (desktopGeometry.width() - windowFrameGeometry.right() - 1 > |
593 if (availableGeometry.width() - windowFrameGeometry.right() - 1 > |
595 self.frameGeometry().width()): |
594 self.frameGeometry().width()): |
596 x = windowFrameGeometry.right() + 1 |
595 x = windowFrameGeometry.right() + 1 |
597 else: |
596 else: |
598 x = windowFrameGeometry.x() - 1 - self.frameGeometry().width() |
597 x = windowFrameGeometry.x() - 1 - self.frameGeometry().width() |
599 |
598 |