More stupid PyQt enums

This commit is contained in:
Kovid Goyal 2020-12-19 12:26:45 +05:30
parent c9f72d9560
commit d416b6440c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 6 additions and 6 deletions

View File

@ -370,8 +370,8 @@ class SchedulerDialog(QDialog):
return QSize(800, 600)
def set_pw_echo_mode(self, state):
self.password.setEchoMode(self.password.Normal
if state == Qt.CheckState.Checked else self.password.Password)
self.password.setEchoMode(QLineEdit.EchoMode.Normal
if state == Qt.CheckState.Checked else QLineEdit.EchoMode.Password)
def schedule_type_selected(self, *args):
for i, st in enumerate(self.SCHEDULE_TYPES):

View File

@ -55,13 +55,13 @@ class TagDelegate(QStyledItemDelegate): # {{{
painter.fillRect(r, bg)
style.proxy().drawPrimitive(style.PE_PanelItemViewItem, option, painter, widget)
painter.setOpacity(0.3)
icon.paint(painter, r, option.decorationAlignment, icon.Normal, icon.On)
icon.paint(painter, r, option.decorationAlignment, QIcon.Mode.Normal, QIcon.Mode.On)
painter.restore()
def draw_icon(self, style, painter, option, widget):
r = style.subElementRect(style.SE_ItemViewItemDecoration, option, widget)
icon = option.icon
icon.paint(painter, r, option.decorationAlignment, icon.Normal, icon.On)
icon.paint(painter, r, option.decorationAlignment, QIcon.Mode.Normal, QIcon.Mode.On)
def paint_text(self, painter, rect, flags, text, hover):
set_color = hover and QApplication.instance().is_dark_theme

View File

@ -117,9 +117,9 @@ class RelaySetup(QDialog):
self.ptoggle = QCheckBox(_('&Show password'), self)
l.addWidget(self.ptoggle, r, 2)
self.ptoggle.stateChanged.connect(
lambda s: self.password.setEchoMode(self.password.Normal if s == Qt.CheckState.Checked else self.password.Password))
lambda s: self.password.setEchoMode(QLineEdit.EchoMode.Normal if s == Qt.CheckState.Checked else QLineEdit.EchoMode.Password))
self.username.setText(service['username'])
self.password.setEchoMode(self.password.Password)
self.password.setEchoMode(QLineEdit.EchoMode.Password)
self.bl = QLabel('<p>' + _(
'If you plan to use email to send books to your Kindle, remember to'
' add your %s email address to the allowed email addresses in your '