[squeak-dev] The Trunk: Morphic-ar.187.mcz

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

[squeak-dev] The Trunk: Morphic-ar.187.mcz

commits-2
Andreas Raab uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ar.187.mcz

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

Name: Morphic-ar.187
Author: ar
Time: 19 September 2009, 9:22:52 am
UUID: 3cb18359-9681-354a-9932-d5fa916986b6
Ancestors: Morphic-ar.186

Add adjustments from hmm for merging scrollbars with the pane borders.

=============== Diff against Morphic-ar.186 ===============

Item was changed:
  ----- Method: ScrollBar>>buttonExtent (in category 'geometry') -----
  buttonExtent
- | size |
- size := Preferences scrollBarsNarrow
- ifTrue: [11]
- ifFalse: [15].
  ^ bounds isWide
+ ifTrue: [self innerBounds height asPoint]
+ ifFalse: [self innerBounds width asPoint]!
- ifTrue: [size @ self innerBounds height]
- ifFalse: [self innerBounds width @ size]!

Item was changed:
  ----- Method: ScrollPane>>hResizeScrollBar (in category 'geometry') -----
  hResizeScrollBar
 
  | topLeft h border |
 
  "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.
 
  topLeft := retractableScrollBar
  ifTrue: [bounds bottomLeft + (border @ border negated)]
  ifFalse: [bounds bottomLeft + (border @ (h + border) negated)].
 
+ hScrollBar bounds: (topLeft + (-1@1) extent: self hScrollBarWidth@ h)
- hScrollBar bounds: (topLeft extent: self hScrollBarWidth@ h)
  !

Item was changed:
  ----- Method: ScrollPane>>vScrollBarHeight (in category 'geometry') -----
  vScrollBarHeight
  | h |
 
+ h := bounds height "- (2 * borderWidth)".
- h := bounds height - (2 * borderWidth).
  (retractableScrollBar not and: [self hIsScrollbarNeeded])
  ifTrue:[ h := h - self scrollBarThickness. ].
 
  ^h
  !

Item was changed:
  ----- Method: ScrollPane>>hScrollBarWidth (in category 'geometry') -----
  hScrollBarWidth
  "Return the width of the horizontal scrollbar"
 
 
  | w |
 
+ w := bounds width "- (2 * borderWidth)".
- w := bounds width - (2 * borderWidth).
 
  (retractableScrollBar not and: [self vIsScrollbarNeeded])
  ifTrue: [w := w - self scrollBarThickness ].
 
  ^w
  !

Item was changed:
  ----- Method: ScrollBar>>totalSliderArea (in category 'geometry') -----
  totalSliderArea
  | upperBoundsButton |
  upperBoundsButton := menuButton ifNil: [upButton].
  bounds isWide
  ifTrue: [
  upButton right > upperBoundsButton right
  ifTrue: [upperBoundsButton := upButton].
+ ^upperBoundsButton bounds topRight - (1@0) corner: downButton bounds bottomLeft + (1@0)]
- ^upperBoundsButton bounds topRight corner: downButton bounds bottomLeft]
  ifFalse:[
  upButton bottom > upperBoundsButton bottom
  ifTrue: [upperBoundsButton := upButton].
+ ^upperBoundsButton bounds bottomLeft - (0@1) corner: downButton bounds topRight + (0@1)].
- ^upperBoundsButton bounds bottomLeft corner: downButton bounds topRight].
  !

Item was changed:
  ----- Method: ScrollPane>>vResizeScrollBar (in category 'geometry') -----
  vResizeScrollBar
  | w topLeft borderHeight innerWidth |
  w := self scrollBarThickness.
  innerWidth := self flatColoredScrollBarLook
  ifTrue:
  [borderHeight := borderWidth.
  0]
  ifFalse:
  [borderHeight := 0.
  1].
  topLeft := scrollBarOnLeft
  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: [-1] ifFalse: [1]) @-1) extent: w @ self vScrollBarHeight)
- bounds: (topLeft extent: w @ self vScrollBarHeight)
 
  !

Item was changed:
  ----- Method: ScrollBar>>initializeUpButton (in category 'initialize') -----
  initializeUpButton
  "initialize the receiver's upButton"
  upButton := self roundedScrollbarLook
  ifTrue: [RectangleMorph
  newBounds: (self innerBounds topLeft extent: self buttonExtent)]
  ifFalse: [RectangleMorph
  newBounds: ((menuButton
  ifNil: [self innerBounds topLeft]
  ifNotNil: [bounds isWide
+ ifTrue: [menuButton bounds topRight - (1@0)]
+ ifFalse: [menuButton bounds bottomLeft - (0@1)]])
- ifTrue: [menuButton bounds topRight]
- ifFalse: [menuButton bounds bottomLeft]])
  extent: self buttonExtent)].
  upButton color: self thumbColor.
  upButton
  on: #mouseDown
  send: #scrollUpInit
  to: self.
  upButton
  on: #mouseUp
  send: #finishedScrolling
  to: self.
  self updateUpButtonImage.
  self roundedScrollbarLook
  ifTrue: [upButton color: Color veryLightGray.
  upButton
  borderStyle: (BorderStyle complexRaised width: 3)]
  ifFalse: [upButton setBorderWidth: 1 borderColor: Color lightGray].
  self addMorph: upButton!

Item was changed:
  ----- Method: ScrollBar>>initializePagingArea (in category 'initialize') -----
  initializePagingArea
  "initialize the receiver's pagingArea"
  pagingArea := RectangleMorph
  newBounds: self totalSliderArea
  color: (Color
  r: 0.6
  g: 0.6
  b: 0.8).
+ pagingArea setBorderWidth: 1 borderColor: Color lightGray.
- pagingArea borderWidth: 0.
  pagingArea
  on: #mouseDown
  send: #scrollPageInit:
  to: self.
  pagingArea
  on: #mouseUp
  send: #finishedScrolling
  to: self.
+ self addMorphBack: pagingArea.
- self addMorph: pagingArea.
  self roundedScrollbarLook
  ifTrue: [pagingArea
  color: (Color gray: 0.9)]!