def __init__(self, parent=None): QLineEdit.__init__(self, parent) self.setAttribute(Qt.WidgetAttribute.WA_MacShowFocusRect, False) self.setStyleSheet( 'QLineEdit { background: transparent; color: %s; selection-background-color: %s }' % ( color('status bar foreground', 'palette(window-text)'), color('status bar selection', 'palette(window-text)'), )) self.search_forward = True self.textEdited.connect(self.text_edited)
def __init__(self, parent=None): QLineEdit.__init__(self, parent) self.setAttribute(Qt.WidgetAttribute.WA_MacShowFocusRect, False) self.setStyleSheet(''' QLineEdit { border-radius: 8px; padding: 1px 6px; background: BG; color: FG; selection-background-color: SEL; } '''.replace('BG', color('status bar background', 'palette(window)')).replace( 'FG', color('status bar foreground', 'palette(window-text)')).replace( 'SEL', color('status bar selection', 'palette(highlight)'))) self.setPlaceholderText(_('Enter command'))