The Trunk: Morphic-mt.885.mcz

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

The Trunk: Morphic-mt.885.mcz

commits-2
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@0] ifFalse:[self scrollBarThickness @ scrollBar minExtent y]).
+ hMin := ((self valueOfProperty: #noHScrollBarPlease ifAbsent: [false])
+ ifTrue:[0@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@0] ifFalse:[scrollBar minExtent])  +
- ((self valueOfProperty: #noHScrollBarPlease ifAbsent: [false])
- ifTrue:[0@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)]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-mt.885.mcz

marcel.taeumel (old)
Note: If you prefer a "bigger thumb to grab" even for long lists, please hide the arrow buttons via the preferences. Otherwise, Squeak assumes that you prefer working with arrow buttons, which always have a reasonable size.

Why? Squeak shrinks the scrollbar's thumb to a minimum to provide a smaller minimal extent while keeping its buttons visible.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-mt.885.mcz

Chris Muller-3
> Note: If you prefer a "bigger thumb to grab" even for long lists, please hide
> the arrow buttons via the preferences. Otherwise, Squeak assumes that you
> prefer working with arrow buttons, which always have a reasonable size.

Wait, I use _all_ the widgets of scroll-bars, I don't "prefer" arrows
or any of them, they're all useful depending on the list.  For
example, when you have a large list with 10K lines in it, arrows are
not going to get you two-thirds the way down by sundown, so that's
when I would grab the "thumb" to get me close, then use the arrows for
fine positioning...

> Why? Squeak shrinks the scrollbar's thumb to a minimum to provide a smaller
> minimal extent while keeping its buttons visible.

Why?  That small is hard to use...

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-mt.885.mcz

marcel.taeumel (old)
But what you should do then is filtering. Then your can browse manually. Not not try to browse 10K items by hand... filter first. Then the thumb will get bigger again.

Anyway: This is a trade-off to support small display sizes. Those displays need small minimum extents.

Best,
Marcel