6 """ |
6 """ |
7 Module implementing a sidebar class. |
7 Module implementing a sidebar class. |
8 """ |
8 """ |
9 |
9 |
10 |
10 |
11 from PyQt5.QtCore import QEvent, QSize, Qt, QByteArray, QDataStream, \ |
11 from PyQt5.QtCore import ( |
12 QIODevice, QTimer |
12 QEvent, QSize, Qt, QByteArray, QDataStream, QIODevice, QTimer |
13 from PyQt5.QtWidgets import QTabBar, QWidget, QStackedWidget, QBoxLayout, \ |
13 ) |
14 QToolButton, QSizePolicy |
14 from PyQt5.QtWidgets import ( |
|
15 QTabBar, QWidget, QStackedWidget, QBoxLayout, QToolButton, QSizePolicy |
|
16 ) |
15 |
17 |
16 from E5Gui.E5Application import e5App |
18 from E5Gui.E5Application import e5App |
17 |
19 |
18 import UI.PixmapCache |
20 import UI.PixmapCache |
19 |
21 |
657 @param old reference to the widget, that lost focus (QWidget or None) |
659 @param old reference to the widget, that lost focus (QWidget or None) |
658 @param now reference to the widget having the focus (QWidget or None) |
660 @param now reference to the widget having the focus (QWidget or None) |
659 """ |
661 """ |
660 if isinstance(now, QWidget): |
662 if isinstance(now, QWidget): |
661 self.__hasFocus = self.isAncestorOf(now) |
663 self.__hasFocus = self.isAncestorOf(now) |
662 if self.__autoHide and not self.__hasFocus and \ |
664 if ( |
663 not self.isMinimized(): |
665 self.__autoHide and |
|
666 not self.__hasFocus and |
|
667 not self.isMinimized() |
|
668 ): |
664 self.shrink() |
669 self.shrink() |
665 elif self.__autoHide and self.__hasFocus and self.isMinimized(): |
670 elif self.__autoHide and self.__hasFocus and self.isMinimized(): |
666 self.expand() |
671 self.expand() |
667 |
672 |
668 def enterEvent(self, event): |
673 def enterEvent(self, event): |