QScintilla/Editor.py

changeset 5733
aed3e558407f
parent 5706
59458b006d76
child 5736
000ea446ff4b
equal deleted inserted replaced
5732:34041e56ec42 5733:aed3e558407f
291 UI.PixmapCache.getPixmap("task.png")) 291 UI.PixmapCache.getPixmap("task.png"))
292 self.warning = self.markerDefine( 292 self.warning = self.markerDefine(
293 UI.PixmapCache.getPixmap("warning.png")) 293 UI.PixmapCache.getPixmap("warning.png"))
294 294
295 # define the line markers 295 # define the line markers
296 self.currentline = self.markerDefine( 296 if Preferences.getEditor("LineMarkersBackground"):
297 UI.PixmapCache.getPixmap("currentLineMarker.png")) 297 self.currentline = self.markerDefine(QsciScintilla.Background)
298 self.errorline = self.markerDefine( 298 self.errorline = self.markerDefine(QsciScintilla.Background)
299 UI.PixmapCache.getPixmap("errorLineMarker.png")) 299 self.__setLineMarkerColours()
300 else:
301 self.currentline = self.markerDefine(
302 UI.PixmapCache.getPixmap("currentLineMarker.png"))
303 self.errorline = self.markerDefine(
304 UI.PixmapCache.getPixmap("errorLineMarker.png"))
300 305
301 self.breakpointMask = (1 << self.breakpoint) | \ 306 self.breakpointMask = (1 << self.breakpoint) | \
302 (1 << self.cbreakpoint) | \ 307 (1 << self.cbreakpoint) | \
303 (1 << self.tbreakpoint) | \ 308 (1 << self.tbreakpoint) | \
304 (1 << self.tcbreakpoint) | \ 309 (1 << self.tcbreakpoint) | \
4006 4011
4007 # set the margins layout 4012 # set the margins layout
4008 if QSCINTILLA_VERSION() >= 0x020301: 4013 if QSCINTILLA_VERSION() >= 0x020301:
4009 self.__unifiedMargins = Preferences.getEditor("UnifiedMargins") 4014 self.__unifiedMargins = Preferences.getEditor("UnifiedMargins")
4010 4015
4016 # set the line marker colours or pixmap
4017 if Preferences.getEditor("LineMarkersBackground"):
4018 self.markerDefine(QsciScintilla.Background, self.currentline)
4019 self.markerDefine(QsciScintilla.Background, self.errorline)
4020 self.__setLineMarkerColours()
4021 else:
4022 self.markerDefine(
4023 UI.PixmapCache.getPixmap("currentLineMarker.png"),
4024 self.currentline)
4025 self.markerDefine(
4026 UI.PixmapCache.getPixmap("errorLineMarker.png"),
4027 self.errorline)
4028
4011 # set the text display 4029 # set the text display
4012 self.__setTextDisplay() 4030 self.__setTextDisplay()
4013 4031
4014 # set margin 0 and 2 configuration 4032 # set margin 0 and 2 configuration
4015 self.__setMarginsDisplay() 4033 self.__setMarginsDisplay()
4065 4083
4066 self.__markerMap.initColors() 4084 self.__markerMap.initColors()
4067 4085
4068 self.settingsRead.emit() 4086 self.settingsRead.emit()
4069 4087
4088 def __setLineMarkerColours(self):
4089 """
4090 Private method to set the line marker colours.
4091 """
4092 self.setMarkerForegroundColor(
4093 Preferences.getEditorColour("CurrentMarker"), self.currentline)
4094 self.setMarkerBackgroundColor(
4095 Preferences.getEditorColour("CurrentMarker"), self.currentline)
4096 self.setMarkerForegroundColor(
4097 Preferences.getEditorColour("ErrorMarker"), self.errorline)
4098 self.setMarkerBackgroundColor(
4099 Preferences.getEditorColour("ErrorMarker"), self.errorline)
4100
4070 def __setMarginsDisplay(self): 4101 def __setMarginsDisplay(self):
4071 """ 4102 """
4072 Private method to configure margins 0 and 2. 4103 Private method to configure margins 0 and 2.
4073 """ 4104 """
4074 # set the settings for all margins 4105 # set the settings for all margins

eric ide

mercurial