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

commits at source.squeak.org commits at source.squeak.org
Thu Apr 16 11:09:17 UTC 2015


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

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

Name: Morphic-mt.885
Author: mt
Time: 16 April 2015, 1:08:44.796 pm
UUID: 0213daef-c58d-bc41-a606-35c001665201
Ancestors: Morphic-mt.884

Minimal extent of slider and scroll bars and scroll panes adapted. To better fit small tool window sizes.

=============== Diff against Morphic-mt.884 ===============

Item was changed:
  ----- Method: ScrollBar>>expandSlider (in category 'geometry') -----
  expandSlider
  	"Compute the new size of the slider (use the old sliderThickness as a minimum)."
  	| r |
  	r := self totalSliderArea.
  	slider extent: (bounds isWide
+ 		ifTrue: [((r width * self interval) asInteger max: self minThumbThickness) @ slider height]
+ 		ifFalse: [slider width @ ((r height * self interval) asInteger max: self minThumbThickness)])!
- 		ifTrue: [((r width * self interval) asInteger max: self sliderThickness) @ slider height]
- 		ifFalse: [slider width @ ((r height * self interval) asInteger max: self sliderThickness)])!

Item was changed:
  ----- Method: ScrollBar>>minExtent (in category 'geometry') -----
  minExtent
  	"The minimum extent is that of 2 or 3 buttons in a row or column,
  	the 'up' and 'down' button and optionally the 'menu' button."
  
+ 	| buttonCount refExtent refBorder |
+ 	refExtent := upButton minExtent.
+ 	refBorder := upButton borderWidth.
+ 	buttonCount := {
- 	| btns cnt |
- 	btns := {
  		upButton visible.
  		downButton visible.
  		self menuButton visible. } count: [:ea | ea].
+ 	^ self bounds isWide
+ 		ifTrue: [((buttonCount * refExtent x) + self minThumbThickness - (buttonCount * refBorder)) @ (self borderWidth + 1)]
+ 		ifFalse: [(self borderWidth + 1) @ ((buttonCount * refExtent y) + self minThumbThickness - (buttonCount * refBorder))]!
- 	cnt := 0 @ btns. "assume vertical layout"
- 	self bounds isWide
- 		ifTrue: [cnt := cnt transposed].
- 	^ (upButton minExtent * cnt) + (self sliderThickness @ self sliderThickness)!

Item was added:
+ ----- Method: ScrollBar>>minThumbThickness (in category 'geometry') -----
+ minThumbThickness
+ 
+ 	^ self class scrollBarsWithoutArrowButtons
+ 		ifTrue: [upButton width]
+ 		ifFalse: [slider borderWidth * 3 "each side + center area"]!

Item was changed:
  ----- Method: ScrollPane>>minScrollbarExtent (in category 'geometry') -----
  minScrollbarExtent
  	"Answer the minimum extent occupied by the receiver..
  	It is assumed the if the receiver is sized to its minimum both scrollbars will be used (and visible) unless they have been turned off explicitly.
  	This makes the behaviour also more predictable."
+ 	| vMin hMin |
+ 	
+ 	vMin :=((self valueOfProperty: #noVScrollBarPlease ifAbsent: [false]) 
+ 		ifTrue:[0 at 0] ifFalse:[self scrollBarThickness @ scrollBar minExtent y]).
+ 	hMin := ((self valueOfProperty: #noHScrollBarPlease ifAbsent: [false]) 
+ 		ifTrue:[0 at 0] ifFalse:[hScrollBar minExtent x @ self scrollBarThickness]).
+ 	
+ 	^ retractableScrollBar
+ 		ifTrue: [hMin x @ vMin y]
+ 		ifFalse: [hMin + vMin "They both need space."]!
- 	^((self valueOfProperty: #noVScrollBarPlease ifAbsent: [false]) 
- 		ifTrue:[0 at 0] ifFalse:[scrollBar minExtent])  +
- 	((self valueOfProperty: #noHScrollBarPlease ifAbsent: [false]) 
- 		ifTrue:[0 at 0] ifFalse:[hScrollBar minExtent])!

Item was changed:
  ----- Method: Slider>>extent: (in category 'geometry') -----
  extent: newExtent
  
  	(bounds extent closeTo: newExtent) ifTrue: [^ self].
  
+ 	super extent: (newExtent max: self minExtent).
- 	bounds isWide
- 		ifTrue: [super extent: (newExtent x max: self sliderThickness * 2) @ newExtent y]
- 		ifFalse: [super extent: newExtent x @ (newExtent y max: self sliderThickness * 2)].
  
  	self updateSlider.!

Item was added:
+ ----- Method: Slider>>minExtent (in category 'geometry') -----
+ minExtent
+ 
+ 	^ self bounds isWide
+ 		ifTrue: [(self sliderThickness * 2) @ (self borderWidth + 1)]
+ 		ifFalse: [(self borderWidth + 1) @ (self sliderThickness * 2)]!



More information about the Squeak-dev mailing list