6 """ |
6 """ |
7 Module implementing the search box for the shel, terminal and log viewer. |
7 Module implementing the search box for the shel, terminal and log viewer. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import pyqtSlot, pyqtSignal, Qt |
10 from PyQt4.QtCore import pyqtSlot, pyqtSignal, Qt |
11 from PyQt4.QtGui import QWidget |
11 from PyQt4.QtGui import QWidget, QSpacerItem, QSizePolicy |
12 |
12 |
13 from .Ui_SearchWidget import Ui_SearchWidget |
13 from .Ui_SearchWidget import Ui_SearchWidget |
14 |
14 |
15 import UI.PixmapCache |
15 import UI.PixmapCache |
16 |
16 |
25 the previous button (string, boolean, boolean) |
25 the previous button (string, boolean, boolean) |
26 """ |
26 """ |
27 searchNext = pyqtSignal(str, bool, bool) |
27 searchNext = pyqtSignal(str, bool, bool) |
28 searchPrevious = pyqtSignal(str, bool, bool) |
28 searchPrevious = pyqtSignal(str, bool, bool) |
29 |
29 |
30 def __init__(self, mainWindow, parent=None): |
30 def __init__(self, mainWindow, parent=None, spacer=True): |
31 """ |
31 """ |
32 Constructor |
32 Constructor |
33 |
33 |
34 @param parent reference to the parent widget (QWidget) |
34 @param parent reference to the parent widget (QWidget) |
|
35 @param spacer flag indicating to add a vertical spacer to the |
|
36 main layout (boolean) |
35 """ |
37 """ |
36 super().__init__(parent) |
38 super().__init__(parent) |
37 self.setupUi(self) |
39 self.setupUi(self) |
|
40 if spacer: |
|
41 spacerItem = QSpacerItem(20, 1, QSizePolicy.Minimum, QSizePolicy.Expanding) |
|
42 self.verticalLayout.addItem(spacerItem) |
38 |
43 |
39 self.__mainWindow = mainWindow |
44 self.__mainWindow = mainWindow |
40 self.__findBackwards = True |
45 self.__findBackwards = True |
41 |
46 |
42 self.closeButton.setIcon(UI.PixmapCache.getIcon("close.png")) |
47 self.closeButton.setIcon(UI.PixmapCache.getIcon("close.png")) |