[squeak-dev] The Trunk: Morphic-cmm.915.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Apr 22 02:29:06 UTC 2015
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.915.mcz
==================== Summary ====================
Name: Morphic-cmm.915
Author: cmm
Time: 21 April 2015, 9:28:06.618 pm
UUID: 4c6df452-dfa8-4352-bb7f-4141b5c43fe8
Ancestors: Morphic-mt.914
- Let forward delete be useful for joining lines.
- Reasonable minimumWidth for PluggableTextMorphs.
- Don't let horizontal splitters be dragged into or above the window title bar.
- Fixed the new concurrent siblings enhancement for horizontal smart splitters.
- Removed an unnecessary contraction from a menu.
=============== Diff against Morphic-mt.914 ===============
Item was added:
+ ----- Method: Editor>>firstWordBoundaryAfter: (in category 'private') -----
+ firstWordBoundaryAfter: position
+ "If the character at position is whitespace, answer the position of the first character after position which is not whitespace.
+ If the character at position is not whitespace, answer the position of the first character after position which is whitespace."
+ | string index atWhitespace |
+ string := self string.
+ index := position.
+ (atWhitespace := (string at: index) isSeparator)
+ ifTrue:
+ [ "find next non-separator"
+ [ (index
+ between: 1
+ and: string size) and: [ (string at: index) isSeparator ] ] whileTrue: [ index := index + 1 ] ]
+ ifFalse:
+ [ "find next separator"
+ [ (index
+ between: 1
+ and: string size) and: [ (string at: index) isSeparator ] ] whileFalse: [ index := index + 1 ] ].
+ ^ index!
Item was added:
+ ----- Method: PluggableTextMorph>>minWidth (in category 'geometry') -----
+ minWidth
+ ^ 38!
Item was changed:
----- Method: ProportionalSplitterMorph>>reduceTopBottomImbalance (in category 'layout') -----
reduceTopBottomImbalance
| correction |
+ (correction := self topBottomCorrection) isZero
- (correction := self topBottomImbalance) isZero
ifTrue:
[ self class smartHorizontalSplitters ifFalse: [ self stopStepping ] ]
ifFalse:
[ (self proposedCorrectionWouldCauseFocusChange: correction) ifFalse: [ self repositionBy: 0 @ correction ] ].
^ correction!
Item was changed:
----- Method: ProportionalSplitterMorph>>step (in category 'events') -----
step
splitsTopAndBottom
+ ifTrue: [ self reduceTopBottomImbalance ]
- ifTrue:
- [ self reduceTopBottomImbalance isZero ifFalse:
- [ self splittersAboveDo:
- [ : splitter | splitter reduceTopBottomImbalance ].
- self splittersBelowDo:
- [ : splitter | splitter reduceTopBottomImbalance ] ] ]
ifFalse:
[ self reduceLeftRightImbalance abs > 1 ifTrue:
[ self splittersLeftDo:
[ : splitter | splitter reduceLeftRightImbalance ].
self splittersRightDo:
[ : splitter | splitter reduceLeftRightImbalance ] ] ]!
Item was changed:
----- Method: ProportionalSplitterMorph>>stepTime (in category 'events') -----
stepTime
"When a splitter finds itself in the right place, let it rest for about 3 seconds to avoid performance impacts of constant, rapid stepping."
| pause |
pause := 3000. "Frozen image when atRandom failed due to lock on its Mutex."
^ ({#(1 -1 1 ). #(-1 1 -1 )} includes: self movements asArray)
ifTrue: [ pause "don't twitch" ]
ifFalse:
[ splitsTopAndBottom
ifTrue:
+ [ self topBottomCorrection isZero
- [ self topBottomImbalance isZero
ifTrue: [ pause ]
ifFalse: [ 0 ] ]
ifFalse:
[ self leftRightImbalance abs > 1
ifTrue: [ ">1 rather than 0 to discourage one-off twitching"
0 ]
ifFalse: [ pause ] ] ]!
Item was added:
+ ----- Method: ProportionalSplitterMorph>>topBottomCorrection (in category 'layout') -----
+ topBottomCorrection
+ ^ self top < self topBoundary
+ ifTrue: [ self topBoundary - self top ]
+ ifFalse:
+ [ self bottom > (self bottomBoundary)
+ ifTrue: [ self bottomBoundary - self bottom ]
+ ifFalse:
+ [ | wsAbove wsBelow |
+ wsAbove := self canEncroachWhiteSpaceOf: leftOrTop.
+ wsBelow := self canEncroachWhiteSpaceOf: rightOrBottom.
+ wsAbove
+ ifTrue:
+ [ wsBelow
+ ifTrue:
+ [ self splitterBelow
+ ifNil: [ 0 ]
+ ifNotNil: [ : below | below topBottomCorrection min: 0 ] ]
+ ifFalse: [ (self top > self topBoundary) ifTrue: [-2] ifFalse: [0] ] ]
+ ifFalse:
+ [ wsBelow
+ ifTrue: [ (self bottom < self bottomBoundary) ifTrue: [2] ifFalse: [0] ]
+ ifFalse:
+ [ self splitterBelow
+ ifNil: [ 0 ]
+ ifNotNil: [ : below | below topBottomCorrection max: 0 ] ] ] ] ]!
Item was removed:
- ----- Method: ProportionalSplitterMorph>>topBottomImbalance (in category 'layout') -----
- topBottomImbalance
- "First check if I find myself out of range due to user having reduced size of parent."
- ^ self bottom < self topBoundary "too high"
- ifTrue: [ 2 ]
- ifFalse:
- [ self top > self bottomBoundary "too low"
- ifTrue: [ -2 ]
- ifFalse:
- [ | wsAbove wsBelow |
- wsAbove := self canEncroachWhiteSpaceOf: leftOrTop.
- wsBelow := self canEncroachWhiteSpaceOf: rightOrBottom.
- wsAbove
- ifTrue:
- [ (wsBelow not and: [ self top > (self topBoundary + 25) ])
- ifTrue: [ -2 ]
- ifFalse: [ 0 ] ]
- ifFalse:
- [ wsBelow
- ifTrue:
- [ self bottom < (self bottomBoundary - 25)
- ifTrue: [ 2 ]
- ifFalse: [ 0 ] ]
- ifFalse: [ 0 ] ] ] ]!
Item was changed:
----- Method: ProportionalSplitterMorph>>topBoundary (in category 'boundaries') -----
topBoundary
"Answer the topmost x position the receiver could be moved to."
| splitter morphs |
splitter := self splitterAbove.
morphs := self commonNeighbours: leftOrTop with: splitter.
^ (splitter
+ ifNil: [owner isSystemWindow ifTrue: [owner panelRect top + owner labelArea height + 3 ]
- ifNil: [owner isSystemWindow ifTrue: [owner panelRect top]
ifFalse: [owner innerBounds top]]
ifNotNil: [splitter bottom])
+ (self minimumHeightOf: morphs)!
Item was added:
+ ----- Method: SystemWindow>>labelArea (in category 'label') -----
+ labelArea
+ ^ labelArea!
Item was changed:
----- Method: TextEditor>>forwardDelete: (in category 'typing/selecting keys') -----
forwardDelete: aKeyboardEvent
"Delete forward over the next character.
Make Undo work on the whole type-in, not just the one char.
wod 11/3/1998: If there was a selection use #zapSelectionWith: rather than #backspace: which was 'one off' in deleting the selection. Handling of things like undo or typeIn area were not fully considered."
| startIndex usel upara uinterval ind stopIndex |
startIndex := self markIndex.
startIndex > self text size ifTrue: [
^ false].
self hasSelection ifTrue: [
"there was a selection"
self zapSelectionWith: self nullText.
^ false].
"Null selection - do the delete forward"
beginTypeInIndex ifNil: [ "no previous typing. openTypeIn"
self openTypeIn. UndoSelection := self nullText].
uinterval := UndoInterval copy.
upara := UndoParagraph copy.
stopIndex := startIndex.
(aKeyboardEvent keyValue = 127 and: [ aKeyboardEvent shiftPressed ])
+ ifTrue: [stopIndex := (self firstWordBoundaryAfter: stopIndex) - 1].
- ifTrue: [stopIndex := (self nextWord: stopIndex) - 1].
self selectFrom: startIndex to: stopIndex.
self replaceSelectionWith: self nullText.
self selectFrom: startIndex to: startIndex-1.
UndoParagraph := upara. UndoInterval := uinterval.
UndoMessage selector == #noUndoer ifTrue: [
(UndoSelection isText) ifTrue: [
usel := UndoSelection.
ind := startIndex. "UndoInterval startIndex"
usel replaceFrom: usel size + 1 to: usel size with:
(UndoParagraph text copyFrom: ind to: ind).
UndoParagraph text replaceFrom: ind to: ind with: self nullText]].
^false!
Item was changed:
----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category 'submenu - windows') -----
listWindowsOn: menu
| windows |
windows := SortedCollection sortBlock: [:winA :winB |
winA model name = winB model name
ifTrue: [winA label < winB label]
ifFalse: [winA model name < winB model name]].
windows addAll: self allVisibleWindows.
windows ifEmpty: [
menu addItem: [ :item |
item
contents: 'No Windows' translated;
isEnabled: false ] ].
windows do: [ :each |
menu addItem: [ :item |
item
contents: (self windowMenuItemLabelFor: each);
icon: (self colorIcon: each model defaultBackgroundColor);
target: each;
selector: #comeToFront;
subMenuUpdater: self
selector: #windowMenuFor:on:
arguments: { each };
action: [ each activateAndForceLabelToShow; expand ] ] ].
menu
addLine;
add: 'Close all windows' target: self selector: #closeAllWindowsUnsafe;
+ add: 'Close all windows without changes' target: self selector: #closeAllWindows;
- add: 'Close all windows w/o changes' target: self selector: #closeAllWindows;
add: 'Close all windows but workspaces' target: self selector: #closeAllWindowsButWorkspaces.!
More information about the Squeak-dev
mailing list
|