--- a/Tools__CodeViewService.st Mon May 16 06:49:42 2016 +0200
+++ b/Tools__CodeViewService.st Tue May 17 07:04:09 2016 +0200
@@ -414,20 +414,40 @@
!CodeViewService methodsFor:'redrawing'!
-drawAnnotationIcon:icon atX:x y:y width:w height:h
+drawAnnotationIcon:icon atX:x y:y width:w height:h ascent:fontAscent
|dy dx|
dx := ((w - icon width) / 2) rounded.
dy := ((h - icon height) / 2) rounded.
icon
displayOn:gutterView
- x:x + dx
+ x:x + dx + 2
y:y - h + dy + 4.
"Created: / 17-09-2013 / 15:40:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg
+drawAnnotationInLine:lineNo in:view atX:x y:yBaseline width:w height:hFont ascent:fontAscent
+ from:startCol to:endColOrNil with:fg and:bg
+ "common code"
+
+ | lang annotation icon severity |
+
+ annotation := self annotationAtLine: lineNo.
+ annotation notNil ifTrue:[
+ severity := annotation rule severity.
+ icon := (severity == #error)
+ ifTrue:[ToolbarIconLibrary smalllintErrorIcon16x16]
+ ifFalse:[
+ (severity == #warning)
+ ifTrue:[ ToolbarIconLibrary smalllintWarningIcon16x16]
+ ifFalse:[ ToolbarIconLibrary smalllintInformationIcon16x16]].
+ self drawAnnotationIcon:icon atX:x y:yBaseline width:w height:hFont ascent:fontAscent.
+ ].
+!
+
+drawLine:lineNo in:view atX:x y:y width:w height:hFont ascent:fontAscent
+ from:startCol to:endColOrNil with:fg and:bg
"Called by both gutterView and textView (well, not yet) to
allow services to draw custom things on text view.