mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pyqt6: More keyboard modifiers nonsense and another py310 float->int
This commit is contained in:
parent
749d0351e8
commit
cfb011c3ff
@ -405,7 +405,7 @@ class NotesDisplay(Details):
|
|||||||
self.setHtml('<div><a href="edit://moo">{}</a></div>{}'.format(_('Edit notes'), html))
|
self.setHtml('<div><a href="edit://moo">{}</a></div>{}'.format(_('Edit notes'), html))
|
||||||
self.document().setDefaultStyleSheet('a[href] { text-decoration: none }')
|
self.document().setDefaultStyleSheet('a[href] { text-decoration: none }')
|
||||||
h = self.document().size().height() + 2
|
h = self.document().size().height() + 2
|
||||||
self.setMaximumHeight(h)
|
self.setMaximumHeight(int(h))
|
||||||
|
|
||||||
def anchor_clicked(self, qurl):
|
def anchor_clicked(self, qurl):
|
||||||
if qurl.scheme() == 'edit':
|
if qurl.scheme() == 'edit':
|
||||||
|
@ -41,8 +41,10 @@ def key_to_text(key):
|
|||||||
def ev_to_index(ev):
|
def ev_to_index(ev):
|
||||||
m = ev.modifiers()
|
m = ev.modifiers()
|
||||||
mods = []
|
mods = []
|
||||||
for x in ('ALT', 'CTRL', 'META', 'SHIFT'):
|
for x in (
|
||||||
mods.append('y' if m & getattr(Qt, x) else 'n')
|
Qt.KeyboardModifier.AltModifier, Qt.KeyboardModifier.ControlModifier,
|
||||||
|
Qt.KeyboardModifier.MetaModifier, Qt.KeyboardModifier.ShiftModifier):
|
||||||
|
mods.append('y' if m & x else 'n')
|
||||||
return ''.join(mods) + key_to_text(ev.key())
|
return ''.join(mods) + key_to_text(ev.key())
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user