Tools__CodeView2.st
changeset 18362 89f3501aec41
parent 18348 b3cdcd31f2cf
child 18497 82d65ac83ddd
equal deleted inserted replaced
18361:8c36423b0914 18362:89f3501aec41
    50 
    50 
    51 SimpleView subclass:#GutterView
    51 SimpleView subclass:#GutterView
    52 	instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel
    52 	instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel
    53 		widthAnnotations widthDiffInfo numberOfLines acceptColor
    53 		widthAnnotations widthDiffInfo numberOfLines acceptColor
    54 		cancelColor diffColor menuHolder currentBlockNodeHolder
    54 		cancelColor diffColor menuHolder currentBlockNodeHolder
    55 		showLineNumbers blockWaitingForPossibleDoubleClick compareAction'
    55 		showLineNumbers blockWaitingForPossibleDoubleClick compareAction
    56 	classVariableNames:''
    56 		lineNrColor'
       
    57 	classVariableNames:'DefaultLineNrColor'
    57 	poolDictionaries:''
    58 	poolDictionaries:''
    58 	privateIn:CodeView2
    59 	privateIn:CodeView2
    59 !
    60 !
    60 
    61 
    61 CodeView subclass:#TextView
    62 CodeView subclass:#TextView
  2457     "superclass AbstractBackground says that I am responsible to implement this method"
  2458     "superclass AbstractBackground says that I am responsible to implement this method"
  2458 
  2459 
  2459     ^ self 
  2460     ^ self 
  2460 ! !
  2461 ! !
  2461 
  2462 
       
  2463 !CodeView2::GutterView class methodsFor:'defaults'!
       
  2464 
       
  2465 updateStyleCache
       
  2466     DefaultLineNrColor := StyleSheet 
       
  2467                             colorAt:#'gutter.lineNrColor' 
       
  2468                             default:[
       
  2469                                 View defaultViewBackgroundColor brightness < 0.8 
       
  2470                                     ifTrue:[Color grey:75]
       
  2471                                     ifFalse:[Color grey]]
       
  2472 
       
  2473     "Created: / 28-08-2018 / 14:59:31 / Claus Gittinger"
       
  2474 ! !
       
  2475 
  2462 !CodeView2::GutterView class methodsFor:'documentation'!
  2476 !CodeView2::GutterView class methodsFor:'documentation'!
  2463 
  2477 
  2464 documentation
  2478 documentation
  2465 "
  2479 "
  2466     documentation to be added.
  2480     documentation to be added.
  2900     ^ textCollector contents.    
  2914     ^ textCollector contents.    
  2901 ! !
  2915 ! !
  2902 
  2916 
  2903 !CodeView2::GutterView methodsFor:'initialize & release'!
  2917 !CodeView2::GutterView methodsFor:'initialize & release'!
  2904 
  2918 
       
  2919 initStyle
       
  2920     super initStyle.
       
  2921 
       
  2922     acceptColor := Color greenCaringForColorBlindness.
       
  2923     cancelColor := Color redCaringForColorBlindness.
       
  2924     diffColor := Color yellow.
       
  2925 
       
  2926     acceptColor := acceptColor lighter onDevice:device.
       
  2927     cancelColor := cancelColor lighter lighter onDevice:device.
       
  2928     diffColor := diffColor lighter lighter onDevice:device.
       
  2929 
       
  2930     lineNrColor := DefaultLineNrColor ? Color grey.
       
  2931 
       
  2932     "Created: / 28-08-2018 / 14:58:43 / Claus Gittinger"
       
  2933 !
       
  2934 
  2905 initialize
  2935 initialize
  2906 
  2936 
  2907     super initialize.
  2937     super initialize.
  2908 
  2938 
  2909     blockWaitingForPossibleDoubleClick := nil.
  2939     blockWaitingForPossibleDoubleClick := nil.
  2911     showLineNumbers := true.
  2941     showLineNumbers := true.
  2912     widthAcceptCancel := 16.
  2942     widthAcceptCancel := 16.
  2913     widthAnnotations := "16"8.
  2943     widthAnnotations := "16"8.
  2914     widthDiffInfo := 5.
  2944     widthDiffInfo := 5.
  2915 
  2945 
  2916     acceptColor := Color greenCaringForColorBlindness.
  2946     self initStyle.
  2917     cancelColor := Color redCaringForColorBlindness.
       
  2918     diffColor := Color yellow.
       
  2919 
       
  2920     acceptColor := acceptColor lighter onDevice:device.
       
  2921     cancelColor := cancelColor lighter lighter onDevice:device.
       
  2922     diffColor := diffColor lighter lighter onDevice:device.
       
  2923 
  2947 
  2924     self enableMotionEvents.   "/ for per-line tooltips
  2948     self enableMotionEvents.   "/ for per-line tooltips
  2925 
  2949 
  2926     "Created: / 16-06-2011 / 13:47:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2950     "Created: / 16-06-2011 / 13:47:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2927     "Modified: / 03-02-2017 / 14:05:03 / cg"
  2951     "Modified: / 03-02-2017 / 14:05:03 / cg"
       
  2952     "Modified: / 28-08-2018 / 14:58:55 / Claus Gittinger"
  2928 !
  2953 !
  2929 
  2954 
  2930 release
  2955 release
  2931     codeView removeDependent: self.  
  2956     codeView removeDependent: self.  
  2932     textView removeDependent: self.
  2957     textView removeDependent: self.
  2972 
  2997 
  2973 lineColorForLine:lineNr
  2998 lineColorForLine:lineNr
  2974     "return special color for given line if required, nil otherwise"
  2999     "return special color for given line if required, nil otherwise"
  2975     "used only if lineFont returns nil"
  3000     "used only if lineFont returns nil"
  2976 
  3001 
  2977     ^ Color grey.
  3002     lineNrColor isNil ifTrue:[
  2978     "/ ^ nil
  3003         View defaultViewBackgroundColor brightness < 0.8 ifTrue:[
       
  3004             lineNrColor := Color grey:75.
       
  3005         ] ifFalse:[    
       
  3006             lineNrColor := Color grey.
       
  3007         ].
       
  3008     ].
       
  3009     ^ lineNrColor.
  2979 
  3010 
  2980     "Created: / 14-12-2009 / 15:01:31 / Jindra <a>"
  3011     "Created: / 14-12-2009 / 15:01:31 / Jindra <a>"
  2981     "Modified: / 28-04-2017 / 08:04:53 / cg"
  3012     "Modified: / 28-04-2017 / 08:04:53 / cg"
       
  3013     "Modified: / 28-08-2018 / 15:05:44 / Claus Gittinger"
  2982 !
  3014 !
  2983 
  3015 
  2984 lineDisplayable:lineNr
  3016 lineDisplayable:lineNr
  2985     "true if this list line can be displayed"
  3017     "true if this list line can be displayed"
  2986     
  3018