The Trunk: Morphic-mt.853.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.853.mcz

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

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

Name: Morphic-mt.853
Author: mt
Time: 10 April 2015, 3:07:39.015 pm
UUID: b6de4c8e-4df3-2946-9608-12ff51775de1
Ancestors: Morphic-mt.852

Some cosmetic fixes in sliders, scroll bars, and scroll panes.

=============== Diff against Morphic-mt.852 ===============

Item was added:
+ ----- Method: ScrollBar>>defaultBorderWidth (in category 'initialize') -----
+ defaultBorderWidth
+ ^ 0!

Item was changed:
  ----- Method: ScrollBar>>updateSlider (in category 'initialize') -----
  updateSlider
 
+ | imagesNeedUpdate |
+ imagesNeedUpdate := upButton width ~= (self bounds isWide ifTrue: [self height] ifFalse: [self width]).
+
  self 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.
+
+ imagesNeedUpdate ifTrue: [
+ self menuButton visible ifTrue: [self updateMenuButtonImage].
+ upButton visible ifTrue: [self updateUpButtonImage].
+ downButton visible ifTrue: [self updateDownButtonImage]].!
- !

Item was changed:
  ----- Method: ScrollBar>>updateSliderColor: (in category 'access') -----
  updateSliderColor: aColor
- | gradient |
 
+ | gradient |
- self borderWidth: 0.
-
  Preferences gradientScrollBars ifFalse: [
  slider
  borderColor: aColor muchDarker;
  color: aColor.
  pagingArea
  borderColor: (aColor muchDarker alpha: pagingArea borderStyle color alpha);
  color: (aColor darker alpha: 0.45).
  ^ self].
 
  slider borderStyle: (BorderStyle width: 1 color: Color lightGray).
 
  "Fill the slider."
  gradient := GradientFillStyle ramp: {
  0 -> (Color gray: 0.95).
  0.49 -> (Color gray: 0.9).
  0.5 -> (Color gray: 0.87).
  1 -> (Color gray: 0.93).
  }.
  gradient origin: slider topLeft.
  gradient direction: (self bounds isWide
  ifTrue:[0@slider height]
  ifFalse:[slider width@0]).
  slider fillStyle: gradient.
 
  "Fill the paging area."
  gradient := GradientFillStyle ramp: {
  0 -> (Color gray: 0.65).
  0.6 -> (Color gray: 0.82).
  1 -> (Color gray: 0.88).
  }.
  gradient origin: self topLeft.
  gradient direction: (self bounds isWide
  ifTrue:[0@self height]
  ifFalse:[self width@0]).
  pagingArea fillStyle: gradient.!

Item was changed:
  ----- Method: ScrollPane>>hResizeScrollBar (in category 'geometry') -----
  hResizeScrollBar
 
  | topLeft h border offset |
 
  "TEMPORARY: IF OLD SCROLLPANES LYING AROUND THAT DON'T HAVE A hScrollBar, INIT THEM"
  hScrollBar ifNil: [ self hInitScrollBarTEMPORARY].
 
  (self valueOfProperty: #noHScrollBarPlease ifAbsent: [false]) ifTrue: [^self].
  bounds ifNil: [ self fullBounds ].
 
  h := self scrollBarThickness.
  border := borderWidth.
  offset := (scrollBarOnLeft and: [self vIsScrollbarShowing])
  ifTrue: [h]
  ifFalse: [0].
 
  topLeft := retractableScrollBar
  ifTrue: [bounds bottomLeft + (border + offset @ border negated)]
  ifFalse: [bounds bottomLeft + (border + offset @ (h + border) negated)].
 
+ hScrollBar bounds: (topLeft + (border negated @ border) extent: self hScrollBarWidth@ h)
- hScrollBar bounds: (topLeft + (-1@1) extent: self hScrollBarWidth@ h)
  !

Item was changed:
  ----- Method: ScrollPane>>initializeScrollBars (in category 'initialization') -----
  initializeScrollBars
  "initialize the receiver's scrollBar"
 
  (scrollBar := ScrollBar on: self getValue: nil setValue: #vScrollBarValue:)
+ menuSelector: #vScrollBarMenuButtonPressed:.
- menuSelector: #vScrollBarMenuButtonPressed:;
- borderWidth: 1;
- borderColor: Color black.
  (hScrollBar := ScrollBar on: self getValue: nil setValue: #hScrollBarValue:)
+ menuSelector: #hScrollBarMenuButtonPressed:.
- menuSelector: #hScrollBarMenuButtonPressed:;
- borderWidth: 1;
- borderColor: Color black.
 
  ""
  scroller := TransformMorph new color: Color transparent.
  scroller offset: 0 @ 0.
  self addMorph: scroller.
  ""
  scrollBar initializeEmbedded: retractableScrollBar not.
  hScrollBar initializeEmbedded: retractableScrollBar not.
  retractableScrollBar ifFalse:
  [self
  addMorph: scrollBar;
  addMorph: hScrollBar].
 
  Preferences alwaysShowVScrollbar ifTrue:
  [ self alwaysShowVScrollBar: true ].
 
  Preferences alwaysHideHScrollbar
  ifTrue:[self hideHScrollBarIndefinitely: true ]
  ifFalse:
  [Preferences alwaysShowHScrollbar ifTrue:
  [ self alwaysShowHScrollBar: true ]].
  !

Item was changed:
  ----- Method: ScrollPane>>innerBounds (in category 'geometry') -----
  innerBounds
  | inner |
  inner := super innerBounds.
  retractableScrollBar | (submorphs includes: scrollBar) not ifFalse:[
  inner := (scrollBarOnLeft
  ifTrue: [scrollBar right @ inner top corner: inner bottomRight]
  ifFalse: [inner topLeft corner: scrollBar left @ inner bottom])
  ].
  (retractableScrollBar | self hIsScrollbarShowing not)
  ifTrue: [^ inner]
+ ifFalse: [^ inner topLeft corner: (inner bottomRight - (0@(self scrollBarThickness - self borderWidth)))].
- ifFalse: [^ inner topLeft corner: (inner bottomRight - (0@(self scrollBarThickness - 1)))].
  !

Item was changed:
  ----- Method: ScrollPane>>vResizeScrollBar (in category 'geometry') -----
  vResizeScrollBar
+ | w topLeft border |
- | w topLeft borderHeight innerWidth |
  w := self scrollBarThickness.
+ border := self borderWidth.
- innerWidth := self flatColoredScrollBarLook
- ifTrue:
- [borderHeight := borderWidth.
- 0]
- ifFalse:
- [borderHeight := 0.
- 1].
  topLeft := scrollBarOnLeft
+ ifTrue: [retractableScrollBar
+ ifTrue: [bounds topLeft - ((w - border) @ border negated)]
+ ifFalse: [bounds topLeft + (border @ border)]]
+ ifFalse: [retractableScrollBar
+ ifTrue: [bounds topRight - (border @ border negated)]
+ ifFalse: [bounds topRight - ((w + border) @ border negated)]].
- ifTrue:
- [retractableScrollBar
- ifTrue: [bounds topLeft - ((w - borderWidth) @ (0 - borderHeight))]
- ifFalse: [bounds topLeft + ((borderWidth - innerWidth) @ borderHeight)]]
- ifFalse:
- [retractableScrollBar
- ifTrue: [bounds topRight - (borderWidth @ (0 - borderHeight))]
- ifFalse:
- [bounds topRight - ((w + borderWidth - innerWidth) @ (0 - borderHeight))]].
 
  scrollBar
+ bounds: (topLeft + ((scrollBarOnLeft ifTrue: [border negated] ifFalse: [border]) @ border negated)
+ extent: w @ self vScrollBarHeight)
- bounds: (topLeft + ((scrollBarOnLeft ifTrue: [-1] ifFalse: [1]) @ -1) extent: w @ self vScrollBarHeight)
 
  !

Item was changed:
  ----- Method: Slider>>extent: (in category 'geometry') -----
  extent: newExtent
+
+ (bounds extent closeTo: newExtent) ifTrue: [^ self].
+
- newExtent = bounds extent ifTrue: [^ self].
  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.!