mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 10:43:52 +02:00
More stupid PyQt enums
This commit is contained in:
parent
c9f72d9560
commit
d416b6440c
3 changed files with 6 additions and 6 deletions
|
|
@ -370,8 +370,8 @@ def sizeHint(self):
|
|||
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):
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@ def draw_average_rating(self, item, style, painter, option, widget):
|
|||
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
|
||||
|
|
|
|||
|
|
@ -117,9 +117,9 @@ def __init__(self, service, parent):
|
|||
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 '
|
||||
|
|
|
|||
Loading…
Reference in a new issue