forked from openlp/openlp
Sort out spelling highlighting
This commit is contained in:
parent
04cfa6a730
commit
26bceb84b9
@ -60,6 +60,8 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
|
|||||||
popup_menu = self.createStandardContextMenu()
|
popup_menu = self.createStandardContextMenu()
|
||||||
# Select the word under the cursor.
|
# Select the word under the cursor.
|
||||||
cursor = self.textCursor()
|
cursor = self.textCursor()
|
||||||
|
# only select text if not already selected
|
||||||
|
if not cursor.hasSelection():
|
||||||
cursor.select(QtGui.QTextCursor.WordUnderCursor)
|
cursor.select(QtGui.QTextCursor.WordUnderCursor)
|
||||||
self.setTextCursor(cursor)
|
self.setTextCursor(cursor)
|
||||||
# Check if the selected word is misspelled and offer spelling
|
# Check if the selected word is misspelled and offer spelling
|
||||||
@ -86,7 +88,6 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
|
|||||||
tag_menu.addAction(action)
|
tag_menu.addAction(action)
|
||||||
popup_menu.insertSeparator(popup_menu.actions()[0])
|
popup_menu.insertSeparator(popup_menu.actions()[0])
|
||||||
popup_menu.insertMenu(popup_menu.actions()[0], tag_menu)
|
popup_menu.insertMenu(popup_menu.actions()[0], tag_menu)
|
||||||
|
|
||||||
popup_menu.exec_(event.globalPos())
|
popup_menu.exec_(event.globalPos())
|
||||||
|
|
||||||
def correctWord(self, word):
|
def correctWord(self, word):
|
||||||
|
Loading…
Reference in New Issue
Block a user