Fwd: [squeak-dev] The Inbox: Morphic-cmm.1116.mcz
Chris Muller
asqueaker at gmail.com
Tue Apr 19 00:50:07 UTC 2016
Hi Eliot, if you would like to merge this as well as Tools-cmm.694, I
hope it will be satisfactory for your de-select + file-out all use
case.
I'll run with it for a few days too, to make sure, before I commit it.
---------- Forwarded message ----------
From: <commits at source.squeak.org>
Date: Mon, Apr 18, 2016 at 6:39 PM
Subject: [squeak-dev] The Inbox: Morphic-cmm.1116.mcz
To: squeak-dev at lists.squeakfoundation.org
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-cmm.1116.mcz
==================== Summary ====================
Name: Morphic-cmm.1116
Author: cmm
Time: 18 April 2016, 6:38:47.481742 pm
UUID: ae46aa73-c96e-41c2-888f-9d3fe8e1b924
Ancestors: Morphic-mt.1115
- Use the "isControlled" variable to instead indicate whether it came
from a mouse move event. This proves useful to at least one model for
implementing a desired UI behavior.
- For vertical smart-splitters, don't let any single line complain any
more than 10-characters worth of occlusion, so that extra long lines
of a list will not over-dominate the adjacent widgets.
=============== Diff against Morphic-mt.1115 ===============
Item was changed:
----- Method: AlternatePluggableListMorphOfMany>>mouseMove: (in
category 'event handling') -----
mouseMove: event
"The mouse has moved, as characterized by the event provided.
Adjust the scrollbar, and alter the selection as appropriate"
| oldIndex oldVal row |
event position y < self top
ifTrue:
[scrollBar scrollUp: 1.
row := self rowAtLocation: scroller topLeft + (1 @ 1)]
ifFalse:
[row := event position y > self bottom
ifTrue:
[scrollBar scrollDown: 1.
self rowAtLocation: scroller
bottomLeft + (1 @ -1)]
ifFalse: [ self rowAtLocation: event position]].
row = 0 ifTrue: [^super mouseDown: event].
model okToChange ifFalse: [^self]. "No change if model is locked"
"Set meaning for subsequent dragging of selection"
oldIndex := self getCurrentSelectionIndex.
oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt: oldIndex].
"Need to restore the old one, due to how model works, and set new one."
oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put: oldVal].
"Inform model of selected item and let it toggle."
self
changeModelSelection: (self modelIndexFor: row)
shifted: true
+ controlled: true.
- controlled: event controlKeyPressed.
submorphs do: [:each | each changed]!
Item was changed:
----- Method: PluggableListMorph>>charactersOccluded (in category
'geometry') -----
charactersOccluded
"Answer the number of characters occluded in my #visibleList
by my right edge."
| listIndex | listIndex:=0.
^ self visibleList
inject: 0
into:
[ : sum : each | | eachString totalWidth
indexOfLastVisible iconWidth |
totalWidth:=0.
eachString := each asString "withBlanksTrimmed".
iconWidth := (self iconAt: (listIndex :=
listIndex+1)) ifNil:[0] ifNotNil: [ : icon | icon width+2 ].
indexOfLastVisible := ((1 to: eachString size)
detect:
[ : stringIndex |
(totalWidth:=totalWidth+(self font widthOf: (eachString at:
stringIndex))) >
(self width -
(scrollBar
ifNil: [ 0 ]
ifNotNil: [ scrollBar width ]) - iconWidth) ]
ifNone: [ eachString size + 1 ]) - 1.
+ sum + ((eachString size - indexOfLastVisible)
min: 10) ]!
- sum + (eachString size - indexOfLastVisible) ]!
More information about the Squeak-dev
mailing list
|