mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More stupid PyQt enums
This commit is contained in:
parent
c9f72d9560
commit
d416b6440c
@ -370,8 +370,8 @@ class SchedulerDialog(QDialog):
|
|||||||
return QSize(800, 600)
|
return QSize(800, 600)
|
||||||
|
|
||||||
def set_pw_echo_mode(self, state):
|
def set_pw_echo_mode(self, state):
|
||||||
self.password.setEchoMode(self.password.Normal
|
self.password.setEchoMode(QLineEdit.EchoMode.Normal
|
||||||
if state == Qt.CheckState.Checked else self.password.Password)
|
if state == Qt.CheckState.Checked else QLineEdit.EchoMode.Password)
|
||||||
|
|
||||||
def schedule_type_selected(self, *args):
|
def schedule_type_selected(self, *args):
|
||||||
for i, st in enumerate(self.SCHEDULE_TYPES):
|
for i, st in enumerate(self.SCHEDULE_TYPES):
|
||||||
|
@ -55,13 +55,13 @@ class TagDelegate(QStyledItemDelegate): # {{{
|
|||||||
painter.fillRect(r, bg)
|
painter.fillRect(r, bg)
|
||||||
style.proxy().drawPrimitive(style.PE_PanelItemViewItem, option, painter, widget)
|
style.proxy().drawPrimitive(style.PE_PanelItemViewItem, option, painter, widget)
|
||||||
painter.setOpacity(0.3)
|
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()
|
painter.restore()
|
||||||
|
|
||||||
def draw_icon(self, style, painter, option, widget):
|
def draw_icon(self, style, painter, option, widget):
|
||||||
r = style.subElementRect(style.SE_ItemViewItemDecoration, option, widget)
|
r = style.subElementRect(style.SE_ItemViewItemDecoration, option, widget)
|
||||||
icon = option.icon
|
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):
|
def paint_text(self, painter, rect, flags, text, hover):
|
||||||
set_color = hover and QApplication.instance().is_dark_theme
|
set_color = hover and QApplication.instance().is_dark_theme
|
||||||
|
@ -117,9 +117,9 @@ class RelaySetup(QDialog):
|
|||||||
self.ptoggle = QCheckBox(_('&Show password'), self)
|
self.ptoggle = QCheckBox(_('&Show password'), self)
|
||||||
l.addWidget(self.ptoggle, r, 2)
|
l.addWidget(self.ptoggle, r, 2)
|
||||||
self.ptoggle.stateChanged.connect(
|
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.username.setText(service['username'])
|
||||||
self.password.setEchoMode(self.password.Password)
|
self.password.setEchoMode(QLineEdit.EchoMode.Password)
|
||||||
self.bl = QLabel('<p>' + _(
|
self.bl = QLabel('<p>' + _(
|
||||||
'If you plan to use email to send books to your Kindle, remember to'
|
'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 '
|
' add your %s email address to the allowed email addresses in your '
|
||||||
|
Loading…
x
Reference in New Issue
Block a user