[squeak-dev] The Trunk: Morphic-mt.943.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Apr 27 15:18:16 UTC 2015


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.943.mcz

==================== Summary ====================

Name: Morphic-mt.943
Author: mt
Time: 27 April 2015, 5:17:30.986 pm
UUID: 6c6c5821-8dc6-d34a-9b1e-c2332f2d895d
Ancestors: Morphic-mt.942

In conjunction with turning off the soft line wrap, we can turn on a visual border to better support manual text composition.

=============== Diff against Morphic-mt.942 ===============

Item was changed:
  ScrollPane subclass: #PluggableTextMorph
+ 	instanceVariableNames: 'textMorph getTextSelector setTextSelector getSelectionSelector hasUnacceptedEdits askBeforeDiscardingEdits selectionInterval hasEditingConflicts editTextSelector wantsWrapBorder'
+ 	classVariableNames: 'AdornmentCache SimpleFrameAdornments SoftLineWrap VisualWrapBorder VisualWrapBorderLimit'
- 	instanceVariableNames: 'textMorph getTextSelector setTextSelector getSelectionSelector hasUnacceptedEdits askBeforeDiscardingEdits selectionInterval hasEditingConflicts editTextSelector'
- 	classVariableNames: 'AdornmentCache SimpleFrameAdornments SoftLineWrap'
  	poolDictionaries: ''
  	category: 'Morphic-Pluggable Widgets'!

Item was added:
+ ----- Method: PluggableTextMorph class>>visualWrapBorder (in category 'preferences') -----
+ visualWrapBorder
+ 	<preference: 'Show wrap border in code panes.'
+ 		categoryList: #(editing visuals performance)
+ 		description: 'Show a visual border after a specific amout of characters. Makes sense for monospaced fonts.'
+ 		type: #Boolean>
+ 	^ VisualWrapBorder ifNil: [false]!

Item was added:
+ ----- Method: PluggableTextMorph class>>visualWrapBorder: (in category 'preferences') -----
+ visualWrapBorder: aBoolean
+ 
+ 	VisualWrapBorder := aBoolean.!

Item was added:
+ ----- Method: PluggableTextMorph class>>visualWrapBorderLimit (in category 'preferences') -----
+ visualWrapBorderLimit
+ 	<preference: 'Wrap border limit'
+ 		categoryList: #(editing visuals performance)
+ 		description: 'Amount of characters after the border should be drawn.'
+ 		type: #Number>
+ 	^ VisualWrapBorderLimit ifNil: [80]!

Item was added:
+ ----- Method: PluggableTextMorph class>>visualWrapBorderLimit: (in category 'preferences') -----
+ visualWrapBorderLimit: aNumber
+ 
+ 	VisualWrapBorderLimit := aNumber asInteger.!

Item was changed:
  ----- Method: PluggableTextMorph>>drawOverlayOn: (in category 'drawing') -----
  drawOverlayOn: aCanvas 
  	"Draw frame adornments on top of everything otherwise they will partially overlap with text selection which looks ugly."
  	
  	super drawOverlayOn: aCanvas. 
+ 	self drawWrapBorderOn: aCanvas.
  	self drawFrameAdornmentsOn: aCanvas.
  !

Item was added:
+ ----- Method: PluggableTextMorph>>drawWrapBorderOn: (in category 'drawing') -----
+ drawWrapBorderOn: aCanvas
+ 
+ 	| offset rect |
+ 	self wantsWrapBorder ifFalse: [^ self].
+ 	textMorph ifNil: [^ self].
+ 	
+ 	offset := (textMorph textStyle defaultFont widthOf: $x) * self class visualWrapBorderLimit.
+ 	offset > self width ifTrue: [^ self].
+ 	
+ 	rect := scroller topLeft + (offset @ 0) corner: scroller bottomRight.
+ 
+ 	aCanvas
+ 		fillRectangle: rect
+ 		color: (self borderStyle color muchLighter alpha: 0.3).
+ 	aCanvas
+ 		line: rect topLeft
+ 		to: rect bottomLeft
+ 		width: self borderStyle width
+ 		color: self borderStyle color.!

Item was added:
+ ----- Method: PluggableTextMorph>>wantsWrapBorder (in category 'accessing') -----
+ wantsWrapBorder
+ 
+ 	^ wantsWrapBorder ifNil: [false]!

Item was added:
+ ----- Method: PluggableTextMorph>>wantsWrapBorder: (in category 'accessing') -----
+ wantsWrapBorder: aBoolean
+ 
+ 	wantsWrapBorder := aBoolean.!



More information about the Squeak-dev mailing list