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

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

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

Name: Morphic-mt.1522
Author: mt
Time: 17 September 2019, 7:11:00.137158 pm
UUID: bad1fd43-540e-c84b-b304-82056b23156b
Ancestors: Morphic-mt.1521

Fixes two bugs in scroll-pane layouts:
- do really a two-pass layout if required; no endless trials
- hide both scroll bars together if it fulfills their #whenNeeded policy

=============== Diff against Morphic-mt.1521 ===============

Item was changed:
  ----- Method: ScrollPane>>doLayoutIn: (in category 'layout') -----
  doLayoutIn: layoutBounds
  "Manually layout my submorphs. Maybe we can find a proper layout policy in the future."
 
  self removeProperty: #doLayoutAgain.
+ self updateLayout.
- self
- resizeScrollBars;
- resizeScroller;
- adjustOffset;
- setScrollDeltas.
 
- "If the scroller happens to have a layout policy, we should compute its layout before any additional run."
- self scroller fullBounds.
-
  "Do one additional run if required."
+ (self hasProperty: #doLayoutAgain)
+ ifTrue: [self updateLayout].
+
- (self hasProperty: #doLayoutAgain) ifTrue: [
- self doLayoutIn: layoutBounds.
- self assert: (self hasProperty: #doLayoutAgain) not.
- ^ self].
-
  super doLayoutIn: layoutBounds.!

Item was changed:
  ----- Method: ScrollPane>>hideOrShowScrollBars (in category 'scrolling') -----
  hideOrShowScrollBars
+
+ "There is the one edge case where no scroll bar would be needed if both scroll bars would just disappear."
+ (((((self vScrollBarPolicy = #whenNeeded and: [self hScrollBarPolicy = #whenNeeded])
+ and: [self retractableScrollBar not])
+ and: [self vIsScrollbarShowing and: [self hIsScrollbarShowing]])
+ and: [self hLeftoverScrollRange <= self vScrollBar width])
+ and: [self vLeftoverScrollRange <= self hScrollBar height])
+ ifTrue: [^ self vHideScrollBar; hHideScrollBar].
 
  self
  vHideOrShowScrollBar;
  hHideOrShowScrollBar.!

Item was added:
+ ----- Method: ScrollPane>>updateLayout (in category 'layout') -----
+ updateLayout
+ "Manually layout my submorphs. Maybe we can find a proper layout policy in the future."
+
+ self
+ resizeScrollBars;
+ resizeScroller;
+ adjustOffset;
+ setScrollDeltas.
+
+ "If the scroller happens to have a layout policy, we should compute its layout before any additional run."
+ self scroller fullBounds.!