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.document().setDefaultStyleSheet('a[href] { text-decoration: none }')
|
||||
h = self.document().size().height() + 2
|
||||
self.setMaximumHeight(h)
|
||||
self.setMaximumHeight(int(h))
|
||||
|
||||
def anchor_clicked(self, qurl):
|
||||
if qurl.scheme() == 'edit':
|
||||
|
@ -41,8 +41,10 @@ def key_to_text(key):
|
||||
def ev_to_index(ev):
|
||||
m = ev.modifiers()
|
||||
mods = []
|
||||
for x in ('ALT', 'CTRL', 'META', 'SHIFT'):
|
||||
mods.append('y' if m & getattr(Qt, x) else 'n')
|
||||
for x in (
|
||||
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())
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user