64 |
64 |
65 @param line line number (integer) |
65 @param line line number (integer) |
66 @param painter reference to the painter (QPainter) |
66 @param painter reference to the painter (QPainter) |
67 @param color color to be used (QColor) |
67 @param color color to be used (QColor) |
68 """ |
68 """ |
69 displayLine = self._master.getVisibleLineFromDocLine(line) |
69 displayLine = self._controller.getVisibleLineFromDocLine(line) |
70 position = self.value2Position(displayLine) |
70 position = self.value2Position(displayLine) |
71 painter.setPen(color) |
71 painter.setPen(color) |
72 painter.setBrush(color) |
72 painter.setBrush(color) |
73 painter.drawRect(self.generateIndicatorRect(position)) |
73 painter.drawRect(self.generateIndicatorRect(position)) |
74 |
74 |
80 """ |
80 """ |
81 # draw indicators in reverse order of priority |
81 # draw indicators in reverse order of priority |
82 |
82 |
83 # 1. changes |
83 # 1. changes |
84 if Preferences.getEditor("ShowMarkerChanges"): |
84 if Preferences.getEditor("ShowMarkerChanges"): |
85 for line in self._master.getChangeLines(): |
85 for line in self._controller.getChangeLines(): |
86 self.__drawIndicator(line, painter, self.__changeColor) |
86 self.__drawIndicator(line, painter, self.__changeColor) |
87 |
87 |
88 # 2. coverage |
88 # 2. coverage |
89 if Preferences.getEditor("ShowMarkerCoverage"): |
89 if Preferences.getEditor("ShowMarkerCoverage"): |
90 for line in self._master.getCoverageLines(): |
90 for line in self._controller.getCoverageLines(): |
91 self.__drawIndicator(line, painter, self.__coverageColor) |
91 self.__drawIndicator(line, painter, self.__coverageColor) |
92 |
92 |
93 # 3. tasks |
93 # 3. tasks |
94 for line in self._master.getTaskLines(): |
94 for line in self._controller.getTaskLines(): |
95 self.__drawIndicator(line, painter, self.__taskColor) |
95 self.__drawIndicator(line, painter, self.__taskColor) |
96 |
96 |
97 # 4. breakpoints |
97 # 4. breakpoints |
98 for line in self._master.getBreakpointLines(): |
98 for line in self._controller.getBreakpointLines(): |
99 self.__drawIndicator(line, painter, self.__breakpointColor) |
99 self.__drawIndicator(line, painter, self.__breakpointColor) |
100 |
100 |
101 # 5. bookmarks |
101 # 5. bookmarks |
102 for line in self._master.getBookmarkLines(): |
102 for line in self._controller.getBookmarkLines(): |
103 self.__drawIndicator(line, painter, self.__bookmarkColor) |
103 self.__drawIndicator(line, painter, self.__bookmarkColor) |
104 |
104 |
105 # 6. search markers |
105 # 6. search markers |
106 if Preferences.getEditor("ShowMarkerSearch"): |
106 if Preferences.getEditor("ShowMarkerSearch"): |
107 for line in self._master.getSearchIndicatorLines(): |
107 for line in self._controller.getSearchIndicatorLines(): |
108 self.__drawIndicator(line, painter, self.__searchMarkerColor) |
108 self.__drawIndicator(line, painter, self.__searchMarkerColor) |
109 |
109 |
110 # 7. warnings |
110 # 7. warnings |
111 for line in self._master.getWarningLines(): |
111 for line in self._controller.getWarningLines(): |
112 self.__drawIndicator(line, painter, self.__warningColor) |
112 self.__drawIndicator(line, painter, self.__warningColor) |
113 |
113 |
114 # 8. VCS conflict markers |
114 # 8. VCS conflict markers |
115 for line in self._master.getVcsConflictMarkerLines(): |
115 for line in self._controller.getVcsConflictMarkerLines(): |
116 self.__drawIndicator(line, painter, self.__vcsConflictMarkerColor) |
116 self.__drawIndicator(line, painter, self.__vcsConflictMarkerColor) |
117 |
117 |
118 # 9. errors |
118 # 9. errors |
119 for line in self._master.getSyntaxErrorLines(): |
119 for line in self._controller.getSyntaxErrorLines(): |
120 self.__drawIndicator(line, painter, self.__errorColor) |
120 self.__drawIndicator(line, painter, self.__errorColor) |
121 |
121 |
122 # 10. current line |
122 # 10. current line |
123 self.__drawIndicator( |
123 self.__drawIndicator( |
124 self._master.getCursorPosition()[0], painter, self.__currentLineMarker |
124 self._controller.getCursorPosition()[0], painter, self.__currentLineMarker |
125 ) |
125 ) |