15 QEvent |
15 QEvent |
16 from PyQt4.QtGui import QDialog, QInputDialog, QApplication, QMenu, QPalette, QFont, \ |
16 from PyQt4.QtGui import QDialog, QInputDialog, QApplication, QMenu, QPalette, QFont, \ |
17 QWidget, QHBoxLayout, QShortcut |
17 QWidget, QHBoxLayout, QShortcut |
18 from PyQt4.Qsci import QsciScintilla |
18 from PyQt4.Qsci import QsciScintilla |
19 |
19 |
20 from E5Gui.E5Application import e5App |
20 from E5Gui.E5Application import e5App, E5Application |
21 |
21 |
22 from . import Lexers |
22 from . import Lexers |
23 from .QsciScintillaCompat import QsciScintillaCompat |
23 from .QsciScintillaCompat import QsciScintillaCompat |
24 |
24 |
25 import Preferences |
25 import Preferences |
377 if Preferences.getEditor("CustomSelectionColours"): |
377 if Preferences.getEditor("CustomSelectionColours"): |
378 self.setSelectionBackgroundColor( |
378 self.setSelectionBackgroundColor( |
379 Preferences.getEditorColour("SelectionBackground")) |
379 Preferences.getEditorColour("SelectionBackground")) |
380 else: |
380 else: |
381 self.setSelectionBackgroundColor( |
381 self.setSelectionBackgroundColor( |
382 QApplication.palette().color(QPalette.Highlight)) |
382 E5Application.palette().color(QPalette.Highlight)) |
383 if Preferences.getEditor("ColourizeSelText"): |
383 if Preferences.getEditor("ColourizeSelText"): |
384 self.resetSelectionForegroundColor() |
384 self.resetSelectionForegroundColor() |
385 elif Preferences.getEditor("CustomSelectionColours"): |
385 elif Preferences.getEditor("CustomSelectionColours"): |
386 self.setSelectionForegroundColor( |
386 self.setSelectionForegroundColor( |
387 Preferences.getEditorColour("SelectionForeground")) |
387 Preferences.getEditorColour("SelectionForeground")) |
388 else: |
388 else: |
389 self.setSelectionForegroundColor( |
389 self.setSelectionForegroundColor( |
390 QApplication.palette().color(QPalette.HighlightedText)) |
390 E5Application.palette().color(QPalette.HighlightedText)) |
391 self.setSelectionToEol(Preferences.getEditor("ExtendSelectionToEol")) |
391 self.setSelectionToEol(Preferences.getEditor("ExtendSelectionToEol")) |
392 self.setCaretForegroundColor( |
392 self.setCaretForegroundColor( |
393 Preferences.getEditorColour("CaretForeground")) |
393 Preferences.getEditorColour("CaretForeground")) |
394 self.setCaretLineBackgroundColor( |
394 self.setCaretLineBackgroundColor( |
395 Preferences.getEditorColour("CaretLineBackground")) |
395 Preferences.getEditorColour("CaretLineBackground")) |