UI/SearchWidget.py

changeset 1833
f7cd855680f1
parent 1830
f2fccb8c2ab4
child 1848
aa5003c03f83
equal deleted inserted replaced
1831:2dd263d670ca 1833:f7cd855680f1
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"))

eric ide

mercurial