The Trunk: Morphic-mt.847.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-mt.847.mcz

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

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

Name: Morphic-mt.847
Author: mt
Time: 9 April 2015, 11:38:46.961 am
UUID: 5a0bfd2b-a16b-934e-9d8f-5ddf580203dc
Ancestors: Morphic-mt.846

Compatibility fix: made menuMorph lazy initialized.

=============== Diff against Morphic-mt.846 ===============

Item was changed:
  ----- Method: ScrollBar>>boundsForUpButton (in category 'initialize') -----
  boundsForUpButton
 
+ ^ (self menuButton visible
- ^ (menuButton visible
  ifFalse: [self innerBounds topLeft]
  ifTrue: [bounds isWide
+ ifTrue: [self menuButton bounds topRight - (1@0)]
+ ifFalse: [self menuButton bounds bottomLeft - (0@1)]])
- ifTrue: [menuButton bounds topRight - (1@0)]
- ifFalse: [menuButton bounds bottomLeft - (0@1)]])
  extent: self buttonExtent!

Item was changed:
  ----- Method: ScrollBar>>hasButtons (in category 'testing') -----
  hasButtons
 
+ ^ (self menuButton visible or: [upButton visible]) or: [downButton visible]!
- ^ (menuButton visible or: [upButton visible]) or: [downButton visible]!

Item was added:
+ ----- Method: ScrollBar>>menuButton (in category 'access') -----
+ menuButton
+
+ ^ menuButton ifNil: [menuButton := RectangleMorph new]!

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."
 
  | btns cnt |
  btns := 2.
+ self menuButton visible ifTrue: [
- menuButton visible ifTrue: [
  btns := btns + 1].
  cnt := 1@btns. "assume vertical layout"
  self bounds isWide
  ifTrue: [cnt := cnt transposed].
  ^ upButton minExtent * cnt!

Item was changed:
  ----- Method: ScrollBar>>sliderColor: (in category 'access') -----
  sliderColor: aColor
  "Change the color of the scrollbar to go with aColor."
  | buttonColor |
  super sliderColor: aColor.
  self updateSliderColor: aColor.
  buttonColor := self thumbColor.
+ self menuButton color: buttonColor.
- menuButton color: buttonColor.
  upButton color: buttonColor.
  downButton color: buttonColor.
 
+ self class updateScrollBarButtonsAspect: {self menuButton. upButton. downButton} color: buttonColor.
- self class updateScrollBarButtonsAspect: {menuButton. upButton. downButton} color: buttonColor.
 
  self updateMenuButtonImage.
  self updateUpButtonImage.
  self updateDownButtonImage.!

Item was changed:
  ----- Method: ScrollBar>>totalSliderArea (in category 'geometry') -----
  totalSliderArea
  | upperReferenceBounds lowerReferenceBounds |
+ upperReferenceBounds := (upButton visible ifFalse: [self menuButton visible ifTrue: [self menuButton] ifFalse: [nil]] ifTrue: [upButton])
- upperReferenceBounds := (upButton visible ifFalse: [menuButton visible ifTrue: [menuButton] ifFalse: [nil]] ifTrue: [upButton])
  ifNil: [self topLeft corner: (bounds isWide ifTrue: [self bottomLeft + (1@0)] ifFalse: [self topRight + (0@1)])]
  ifNotNil: [:button | button bounds].
  lowerReferenceBounds := downButton visible
  ifFalse: [(bounds isWide ifTrue: [self topRight - (1@0)] ifFalse: [self bottomLeft - (0@1)]) corner: self bottomRight]
  ifTrue: [downButton bounds].
  ^ bounds isWide
  ifTrue: [upperReferenceBounds topRight - (1@0) corner: lowerReferenceBounds bottomLeft + (1@0)]
  ifFalse:[upperReferenceBounds bottomLeft - (0@1) corner: lowerReferenceBounds topRight + (0@1)].
  !

Item was changed:
  ----- Method: ScrollBar>>updateMenuButtonImage (in category 'initialize') -----
  updateMenuButtonImage
  "update the receiver's menuButton. put a new image inside"
 
+ self menuButton removeAllMorphs.
+ self menuButton addMorphCentered: (ImageMorph new image: self menuImage).!
- menuButton removeAllMorphs.
- menuButton addMorphCentered: (ImageMorph new image: self menuImage).!

Item was changed:
  ----- Method: ScrollBar>>updateSlider (in category 'initialize') -----
  updateSlider
 
+ self menuButton
- menuButton
  visible: (self bounds isWide or: [self class scrollBarsWithoutMenuButton]) not;
  bounds: self boundsForMenuButton.
  upButton
  visible: self class scrollBarsWithoutArrowButtons not;
  bounds: self boundsForUpButton.
  downButton
  visible: self class scrollBarsWithoutArrowButtons not;
  bounds: self boundsForDownButton.
 
  super updateSlider.
 
  pagingArea bounds: self totalSliderArea.
 
  self expandSlider.
  !