Edit Book: Fix context menu positioning in code editor

There was a slight offset in the positioning caused by calculating the
position w.r.t. to the widget instead of the viewport.
This commit is contained in:
Kovid Goyal 2016-02-28 17:39:37 +05:30
parent 316201354c
commit a7ae71e41f

View File

@ -561,7 +561,7 @@ class Editor(QMainWindow):
m.addMenu(cm) m.addMenu(cm)
if self.syntax == 'html': if self.syntax == 'html':
m.addAction(actions['multisplit']) m.addAction(actions['multisplit'])
m.exec_(self.editor.mapToGlobal(pos)) m.exec_(self.editor.viewport().mapToGlobal(pos))
def goto_sourceline(self, *args, **kwargs): def goto_sourceline(self, *args, **kwargs):
return self.editor.goto_sourceline(*args, **kwargs) return self.editor.goto_sourceline(*args, **kwargs)