Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1526.mcz
==================== Summary ====================
Name: Morphic-mt.1526
Author: mt
Time: 20 September 2019, 7:32:57.883764 pm
UUID: bc706b68-7e7e-dc44-a2a7-07af99cbb7f8
Ancestors: Morphic-mt.1525
Cleans up methods for scroll-range calculation in scroll panes.
=============== Diff against Morphic-mt.1525 ===============
Item was removed:
- ----- Method: PluggableListMorph>>hExtraScrollRange (in category 'scrolling') -----
- hExtraScrollRange
- "Return the amount of extra blank space to include to the right of the scroll content."
- ^5
- !
Item was changed:
----- Method: PluggableListMorph>>hUnadjustedScrollRange (in category 'scroll cache') -----
hUnadjustedScrollRange
+ "Override because our lazy list approximates the width for performance reasons."
- "Return the entire scrolling range."
self resetHScrollRangeIfNecessary.
^hScrollRangeCache second
!
Item was removed:
- ----- Method: PluggableListMorph>>vUnadjustedScrollRange (in category 'scrolling') -----
- vUnadjustedScrollRange
- "Return the height extent of the receiver's submorphs."
- (scroller submorphs size > 0) ifFalse:[ ^0 ].
- ^(scroller submorphs last fullBounds bottom)
- !
Item was changed:
----- Method: ScrollPane>>hUnadjustedScrollRange (in category 'geometry ranges') -----
hUnadjustedScrollRange
"Return the width extent of the receiver's submorphs."
+ ^ scroller localSubmorphBounds width!
- | submorphBounds |
- submorphBounds := scroller localSubmorphBounds ifNil: [^ 0].
- ^ submorphBounds right
- !
Item was changed:
----- Method: ScrollPane>>vUnadjustedScrollRange (in category 'geometry ranges') -----
vUnadjustedScrollRange
"Return the height extent of the receiver's submorphs."
+
+ ^ scroller localSubmorphBounds height!
- | submorphBounds |
- submorphBounds := scroller localSubmorphBounds ifNil: [^ 0].
- ^ submorphBounds bottom
- !
Item was removed:
- ----- Method: SimpleHierarchicalListMorph>>hExtraScrollRange (in category 'scrolling') -----
- hExtraScrollRange
- "Return the amount of extra blank space to include below the bottom of the scroll content."
- ^5
- !
Item was changed:
----- Method: SimpleHierarchicalListMorph>>hUnadjustedScrollRange (in category 'scrolling') -----
hUnadjustedScrollRange
"Return the width of the widest item in the list"
| max count |
+ self flag: #tofix. "mt: What about icons and columns? Do we ever show horizontal scroll bars for such tree views anyway? Maybe just return 0?"
+
-
max := 0.
count := 0.
scroller submorphsDo: [ :each | | stringW right |
stringW := each font widthOfStringOrText: each contents.
right := (each toggleRectangle right + stringW + 10).
max := max max: right.
"NOTE: need to optimize this method by caching list item morph widths (can init that cache most efficiently in the #list: method before the item widths are reset to 9999). For now, just punt on really long lists"
((count := count + 1) > 200) ifTrue:[ ^max * 3].
].
^max
!
Item was removed:
- ----- Method: SimpleHierarchicalListMorph>>vUnadjustedScrollRange (in category 'scrolling') -----
- vUnadjustedScrollRange
- "Return the width of the widest item in the list"
-
- (scroller submorphs size > 0) ifFalse:[ ^0 ].
- ^scroller submorphs last fullBounds bottom
- !
Item was changed:
----- Method: TransformMorph>>layoutBounds (in category 'layout') -----
layoutBounds
+ "Ignore scaling and offset but move to local origin for my children as reference point. Note that we do not have to adapt #submorphBoundsForShrinkWrap because those are already in local coordinates. See #adjustLayoutBounds and #setLayoutBoundsFromLayout:"
- "Ignore scaling and offset but move to local origin for my children as reference point. Note that we do not have to adapt #submorphBoundsForShrinkWrap because those are already in local coordinates."
^ super layoutBounds translateBy: self topLeft negated!
Item was changed:
----- Method: TransformMorph>>localSubmorphBounds (in category 'geometry') -----
localSubmorphBounds
"Answer, in my coordinate system, the bounds of all my submorphs (or nil if no submorphs). We will cache this value for performance. The value is invalidated upon recieving #layoutChanged."
+ ^ localBounds ifNil: [localBounds := super submorphBounds]!
- localBounds ifNil:[
- self submorphsDo:[:m |
- localBounds ifNil: [localBounds := m fullBounds]
- ifNotNil: [localBounds := localBounds quickMerge: m fullBounds]].
- ].
-
- ^ localBounds!
Item was removed:
- ----- Method: TransformMorph>>localVisibleSubmorphBounds (in category 'geometry') -----
- localVisibleSubmorphBounds
- "Answer, in my coordinate system, the bounds of all my visible submorphs (or nil if no visible submorphs)"
- | subBounds |
- subBounds := nil.
- self submorphsDo: [:m |
- (m visible) ifTrue: [
- subBounds
- ifNil: [subBounds := m fullBounds copy]
- ifNotNil: [subBounds := subBounds quickMerge: m fullBounds]]
- ].
- ^subBounds!
Item was changed:
----- Method: TransformMorph>>submorphBounds (in category 'layout') -----
submorphBounds
"Answer, in owner coordinates, the bounds of my visible submorphs, or my bounds"
| box |
+ box := self localSubmorphBounds.
- box := self localVisibleSubmorphBounds.
^(box ifNotNil: [ transform localBoundsToGlobal: box ] ifNil: [ self bounds ]) truncated.
!
Levente Uzonyi uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ul.701.mcz
==================== Summary ====================
Name: Monticello-ul.701
Author: ul
Time: 20 September 2019, 1:49:22.872448 am
UUID: 6200146e-6bc8-483d-b784-34aeccaaa967
Ancestors: Monticello-pre.700
- assume that WebClient is always present in the image when Monticello is. This makes the Monticello package depend on the WebClient-Core package.
- when using the shared WebClient instance during downloads, check if the client is still connected. If the client is not connected, e.g. the image was restarted, force the recreation of its stream by sending #close to the client.
- use the same code instead of the HTTPSocket fallback in MCHttpRepository>>httpGet:arguments: when the #useSharedWebClientInstance preference is disabled
=============== Diff against Monticello-pre.700 ===============
Item was changed:
----- Method: MCHttpRepository class>>useSharedWebClientInstance (in category 'preferences') -----
useSharedWebClientInstance
<preference: 'Use shared WebClient instance'
category: 'Monticello'
description: 'When true, use a shared WebClient instance to speed up downloads from MCHttpRepositories. Requires WebClient to be present.'
type: #Boolean>
+ ^UseSharedWebClientInstance ifNil: [ true ]!
- ^UseSharedWebClientInstance ifNil: [ Smalltalk hasClassNamed: #WebClient ]!
Item was changed:
----- Method: MCHttpRepository>>httpGet:arguments: (in category 'private') -----
httpGet: url arguments: arguments
| progress urlString client response result |
- self class useSharedWebClientInstance ifFalse: [
- ^HTTPSocket httpGet: url args: arguments user: self user passwd: self password ].
progress := [ :total :amount |
HTTPProgress new
total: total;
amount: amount;
signal: 'Downloading...' ].
urlString := arguments
ifNil: [ url ]
ifNotNil: [
| queryString |
+ queryString := WebUtils encodeUrlEncodedForm: arguments.
- queryString := (Smalltalk classNamed: #WebUtils) encodeUrlEncodedForm: arguments.
(url includes: $?)
ifTrue: [ url, '&', queryString ]
ifFalse: [ url, '?', queryString ] ].
+ self class useSharedWebClientInstance ifTrue: [
+ "Acquire webClient by atomically storing it in the client variable and setting its value to nil."
+ client := webClient.
+ webClient := nil ].
+ client
+ ifNil: [ client := WebClient new ]
+ ifNotNil: [
+ "Attempt to avoid an error on windows by recreating the underlying stream."
+ client isConnected ifFalse: [ client close ] ].
- "Acquire webClient by atomically storing it in the client variable and setting its value to nil."
- client := webClient.
- webClient := nil.
- client ifNil: [ client := (Smalltalk classNamed: #WebClient) new ].
response := client
username: self user;
password: self password;
httpGet: urlString do: [ :request |
request
headerAt: 'Authorization' put: 'Basic ', (self user, ':', self password) base64Encoded;
headerAt: 'Connection' put: 'Keep-Alive';
headerAt: 'Accept' put: '*/*' ].
result := (response code between: 200 and: 299)
ifFalse: [
response content. "Make sure content is read."
nil ]
ifTrue: [ (RWBinaryOrTextStream with: (response contentWithProgress: progress)) reset ].
+ self class useSharedWebClientInstance
+ ifTrue: [
+ "Save the WebClient instance for reuse, but only if there is no client cached."
+ webClient
+ ifNil: [ webClient := client ]
+ ifNotNil: [ client close ] ]
+ ifFalse: [ client close ].
+ result ifNil: [ NetworkError signal: 'Could not access ', location ].
+ ^result!
- "Save the WebClient instance for reuse, but only if there is no client cached."
- webClient
- ifNil: [ webClient := client ]
- ifNotNil: [ client close ].
- ^result ifNil: [
- NetworkError signal: 'Could not access ', location.
- nil ]!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1525.mcz
==================== Summary ====================
Name: Morphic-mt.1525
Author: mt
Time: 19 September 2019, 5:20:06.518125 pm
UUID: a141a369-ecd4-3e4b-a1ad-fe7a82e7d186
Ancestors: Morphic-mt.1524
Allow system windows to override the system-wide "rounded window corners" preference. Used for tests.
=============== Diff against Morphic-mt.1524 ===============
Item was changed:
----- Method: Morph>>cornerStyle: (in category 'rounding') -----
cornerStyle: aSymbol
"This method makes it possible to set up desired corner style. aSymbol has to be one of:
#square
#rounded"
+ self setProperty: #cornerStyle toValue: aSymbol.
+ self changed.!
- aSymbol == #square
- ifTrue:[self removeProperty: #cornerStyle]
- ifFalse:[self setProperty: #cornerStyle toValue: aSymbol].
- self changed!
Item was changed:
----- Method: SystemWindow>>wantsRoundedCorners (in category 'drawing') -----
wantsRoundedCorners
+
+ ^ (self hasProperty: #cornerStyle)
+ ifTrue: [super wantsRoundedCorners]
+ ifFalse: [self class roundedWindowCorners]!
- ^ self class roundedWindowCorners or: [super wantsRoundedCorners]!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1524.mcz
==================== Summary ====================
Name: Morphic-mt.1524
Author: mt
Time: 19 September 2019, 4:47:08.121125 pm
UUID: 883ea759-a904-dd42-8549-8f2c64cae163
Ancestors: Morphic-mt.1523
Layout fixes and layout-configuration robustness:
- Makes ScrollPane compatible with #shrinkWrap
- Adds checks for common layout properties to guard against common mistakes such as "shrinkWrap" vs. "srinkWrap" and "spaceFill" vs. "spaceFIll".
- Adds missing #layoutChanged calls to ScrollPane
- Better commentary in TransformMorph >> #layoutBounds
- Makes the ScrollPane's TransformMorph (i.e. scroller) have the resizing properties (#shrinkWrap/#spaceFill) as applied in ScrollPane >> #doLayoutIn:, which is a custom layout strategy - not a policy.
=============== Diff against Morphic-mt.1523 ===============
Item was changed:
----- Method: Morph>>cellSpacing: (in category 'layout-properties') -----
cellSpacing: aSymbol
"Layout specific. This property describes how the cell size for each element in a list should be computed.
#globalRect - globally equal rectangular cells
#globalSquare - globally equal square cells
#localRect - locally (e.g., per row/column) equal rectangular cells
#localSquare - locally (e.g., per row/column) equal square cells
#none - cells are sized based on available row/column constraints
"
+ self checkCellSpacingProperty: aSymbol.
- self assert: aSymbol isSymbol. "Guard against a common mistake."
self assureTableProperties cellSpacing: aSymbol.
self layoutChanged.!
Item was added:
+ ----- Method: Morph>>checkCellSpacingProperty: (in category 'layout') -----
+ checkCellSpacingProperty: aSymbol
+
+ aSymbol == #none ifTrue: [^ self].
+
+ aSymbol == #globalRect ifTrue: [^ self].
+ aSymbol == #globalSquare ifTrue: [^ self].
+ aSymbol == #localRect ifTrue: [^ self].
+ aSymbol == #localSquare ifTrue: [^ self].
+
+ Error signal: 'Invalid cell-spacing property. Use #none, #globalRect, #globalSquare, #localRect, or #localSquare.'.!
Item was added:
+ ----- Method: Morph>>checkListSpacingProperty: (in category 'layout') -----
+ checkListSpacingProperty: aSymbol
+
+ aSymbol == #none ifTrue: [^ self].
+ aSymbol == #equal ifTrue: [^ self].
+
+ Error signal: 'Invalid value for list-spacing property. Use #none or #equal.'.!
Item was added:
+ ----- Method: Morph>>checkResizingProperty: (in category 'layout') -----
+ checkResizingProperty: aSymbol
+
+ aSymbol == #rigid ifTrue: [^ self].
+ aSymbol == #shrinkWrap ifTrue: [^ self].
+ aSymbol == #spaceFill ifTrue: [^ self].
+
+ Error signal: 'Invalid value for resizing property. Use #rigid, #shrinkWrap, or #spaceFill.'.!
Item was changed:
----- Method: Morph>>hResizing: (in category 'layout-properties') -----
hResizing: aSymbol
"Layout specific. This property describes how the receiver should be resized with respect to its owner and its children. Possible values are:
#rigid - do not resize the receiver
#spaceFill - resize to fill owner's available space
#shrinkWrap - resize to fit children
"
+ self checkResizingProperty: aSymbol.
self assureLayoutProperties hResizing: aSymbol.
self layoutChanged.
!
Item was changed:
----- Method: Morph>>listSpacing: (in category 'layout-properties') -----
listSpacing: aSymbol
"Layout specific. This property describes how the heights for different rows in a table layout should be handled.
#equal - all rows have the same height
#none - all rows may have different heights
"
+ self checkListSpacingProperty: aSymbol.
- self assert: aSymbol isSymbol. "Guard against a common mistake."
self assureTableProperties listSpacing: aSymbol.
self layoutChanged.!
Item was changed:
----- Method: Morph>>vResizing: (in category 'layout-properties') -----
vResizing: aSymbol
"Layout specific. This property describes how the receiver should be resized with respect to its owner and its children. Possible values are:
#rigid - do not resize the receiver
#spaceFill - resize to fill owner's available space
#shrinkWrap - resize to fit children
"
+ self checkResizingProperty: aSymbol.
self assureLayoutProperties vResizing: aSymbol.
self layoutChanged.
!
Item was changed:
----- Method: ScrollPane>>alwaysShowHScrollBar (in category 'accessing options') -----
alwaysShowHScrollBar
self hScrollBarPolicy: #always.
- self hHideOrShowScrollBar.
!
Item was changed:
----- Method: ScrollPane>>alwaysShowVScrollBar (in category 'accessing options') -----
alwaysShowVScrollBar
self vScrollBarPolicy: #always.
- self vHideOrShowScrollBar.
!
Item was added:
+ ----- Method: ScrollPane>>checkScrollBarPolicy: (in category 'layout') -----
+ checkScrollBarPolicy: aSymbol
+
+ aSymbol == #never ifTrue: [^ self].
+ aSymbol == #whenNeeded ifTrue: [^ self].
+ aSymbol == #always ifTrue: [^ self].
+
+ Error signal: 'Invalid value for scrollbar policy. Use #never, #whenNeeded, or #always.'.!
Item was changed:
----- Method: ScrollPane>>doLayoutIn: (in category 'layout') -----
doLayoutIn: layoutBounds
"Manually layout my submorphs. Maybe we can find a proper layout policy in the future."
+ "1) Let submorph's #shrinkWrap first if they want to."
+ self submorphsDo: [:m | m fullBounds].
+
self removeProperty: #doLayoutAgain.
self updateLayout.
+ super doLayoutIn: layoutBounds.
-
- "Do one additional run if required."
- (self hasProperty: #doLayoutAgain)
- ifTrue: [self updateLayout].
+ "Do one additional run if required."
+ (self hasProperty: #doLayoutAgain) ifTrue: [
+ self updateLayout.
+ super doLayoutIn: layoutBounds].!
- super doLayoutIn: layoutBounds.!
Item was changed:
----- Method: ScrollPane>>extentToFit (in category 'geometry') -----
extentToFit
"Resize scroll pane to exactly fit its contents."
| offset |
offset := 0@0.
(retractableScrollBar not and: [self vScrollBarPolicy == #always])
ifTrue: [offset := (self scrollBarThickness - self borderWidth) @ offset y].
(retractableScrollBar not and: [self hScrollBarPolicy == #always])
ifTrue: [offset := offset x @ (self scrollBarThickness - self borderWidth)].
+ ^ scroller submorphBounds extent + offset + (2* (self borderWidth @ self borderWidth))!
- ^ scroller submorphBoundsForShrinkWrap extent + offset + (2* (self borderWidth @ self borderWidth))!
Item was added:
+ ----- Method: ScrollPane>>hResizing: (in category 'layout') -----
+ hResizing: aSymbol
+ "Pass #shrinkWrap property to scroller to make this scroll pane's layout work. See #doLayoutIn:."
+
+ super hResizing: aSymbol.
+
+ scroller hResizing: (aSymbol == #shrinkWrap
+ ifTrue: [#shrinkWrap]
+ ifFalse: [#spaceFill]).!
Item was changed:
----- Method: ScrollPane>>hScrollBarPolicy: (in category 'accessing') -----
hScrollBarPolicy: aSymbol
"#always, #never, #whenNeeded"
+ hScrollBarPolicy = aSymbol ifTrue: [^ self].
+ self checkScrollBarPolicy: aSymbol.
+
+ hScrollBarPolicy := aSymbol.
+ self layoutChanged.!
- hScrollBarPolicy := aSymbol.!
Item was changed:
----- Method: ScrollPane>>initializeScrollBars (in category 'initialization') -----
initializeScrollBars
"Initialize vertical and horizontal scroll bars."
(scrollBar := ScrollBar on: self getValue: nil setValue: #vScrollBarValue:)
menuSelector: #vScrollBarMenuButtonPressed:;
orientation: #vertical;
extent: 1@1.
(hScrollBar := ScrollBar on: self getValue: nil setValue: #hScrollBarValue:)
menuSelector: #hScrollBarMenuButtonPressed:;
orientation: #horizontal;
extent: 1@1.
""
+ scroller := TransformMorph new
+ color: Color transparent;
+ hResizing: #spaceFill;
+ vResizing: #spaceFill.
- scroller := TransformMorph new color: Color transparent.
scroller offset: 0 @ 0.
self addMorph: scroller.
""
retractableScrollBar ifFalse:
[self
addMorph: scrollBar;
addMorph: hScrollBar].
self updateMinimumExtent.!
Item was added:
+ ----- Method: ScrollPane>>submorphBoundsForShrinkWrap (in category 'layout') -----
+ submorphBoundsForShrinkWrap
+ "No need to consider scrollbars because those are placed outside the #innerBounds like a border. See #resizeScroller."
+
+ ^ scroller bounds!
Item was changed:
----- Method: ScrollPane>>updateLayout (in category 'layout') -----
updateLayout
"Manually layout my submorphs. Maybe we can find a proper layout policy in the future."
+ "If the scroller happens to have a layout policy, we should compute its layout before updating the scroll bars"
+ self resizeScroller.
+ self scroller fullBounds.
+
self
resizeScrollBars;
- resizeScroller;
adjustOffset;
setScrollDeltas.
+
+
+ !
-
- "If the scroller happens to have a layout policy, we should compute its layout before any additional run."
- self scroller fullBounds.!
Item was added:
+ ----- Method: ScrollPane>>vResizing: (in category 'layout') -----
+ vResizing: aSymbol
+ "Pass #shrinkWrap property to scroller to make this scroll pane's layout work. See #doLayoutIn:."
+
+ super vResizing: aSymbol.
+
+ scroller vResizing: (aSymbol == #shrinkWrap
+ ifTrue: [#shrinkWrap]
+ ifFalse: [#spaceFill]).!
Item was changed:
----- Method: ScrollPane>>vScrollBarPolicy: (in category 'accessing') -----
vScrollBarPolicy: aSymbol
"#always, #never, #whenNeeded"
+ vScrollBarPolicy = aSymbol ifTrue: [^ self].
+ self checkScrollBarPolicy: aSymbol.
+
+ vScrollBarPolicy := aSymbol.
+ self layoutChanged.!
- vScrollBarPolicy := aSymbol.!
Item was changed:
----- Method: TransformMorph>>layoutBounds (in category 'layout') -----
layoutBounds
+ "Ignore scaling and offset but move to local origin for my children as reference point. Note that we do not have to adapt #submorphBoundsForShrinkWrap because those are already in local coordinates."
- "Ignore scaling and offset but move to local origin for my children as reference point."
^ super layoutBounds translateBy: self topLeft negated!
Marcel Taeumel uploaded a new version of ToolBuilder-Kernel to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Kernel-mt.132.mcz
==================== Summary ====================
Name: ToolBuilder-Kernel-mt.132
Author: mt
Time: 18 September 2019, 4:54:47.269955 pm
UUID: 64a42905-ca5e-3e42-b14f-45fa808ed3fb
Ancestors: ToolBuilder-Kernel-mt.131
Also debugger-tools should return their tool window through the ToolBuilder interface.
=============== Diff against ToolBuilder-Kernel-mt.131 ===============
Item was changed:
----- Method: ToolBuilder>>openDebugger: (in category 'opening') -----
openDebugger: aSpec
"Build and open a debugger from the given spec.
Answer the widget opened. Subclasses can override this
method if opening a debugger has specific requirements
different from opening other widgets."
+ ^ self open: aSpec
- self open: aSpec
!
Item was changed:
----- Method: ToolBuilder>>openDebugger:label:closing: (in category 'opening') -----
openDebugger: aSpec label: aString closing: topView
"Build and open a debugger from the given spec, labeling it appropriately.
Answer the widget opened. Subclasses can override this
method if opening a debugger has specific requirements
different from opening other widgets."
self close: topView.
+ ^ self open: aSpec label: aString
- self open: aSpec label: aString
!