eric7/WebBrowser/TabManager/TabManagerWidget.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8354
12ebd3934fef
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
22 ) 22 )
23 23
24 import EricNetwork 24 import EricNetwork
25 from EricNetwork import EricTldExtractor 25 from EricNetwork import EricTldExtractor
26 26
27 from E5Gui.E5Application import e5App 27 from E5Gui.EricApplication import ericApp
28 from E5Gui.E5ClickableLabel import E5ClickableLabel 28 from E5Gui.EricClickableLabel import EricClickableLabel
29 29
30 import Utilities 30 import Utilities
31 import UI.PixmapCache 31 import UI.PixmapCache
32 import Preferences 32 import Preferences
33 33
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

eric ide

mercurial