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

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

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

Name: Morphic-mt.1273
Author: mt
Time: 13 August 2016, 1:05:42.232735 pm
UUID: a498c86a-0209-bc43-80d0-03a0fa6ec7d2
Ancestors: Morphic-mt.1272

Fixes a bug in new-style balloon morphs, which did not honor custom text attributes and the ballon-owner's balloon color.

=============== Diff against Morphic-mt.1272 ===============

Item was changed:
  ----- Method: NewBalloonMorph>>balloonOwner: (in category 'accessing') -----
  balloonOwner: aMorph
 
+ balloonOwner == aMorph ifTrue: [^ self].
+ balloonOwner := aMorph.
+ self updateColorsForBalloonOwner.!
- balloonOwner := aMorph.!

Item was changed:
  ----- Method: NewBalloonMorph>>setText: (in category 'initialization') -----
  setText: stringOrText
 
  | text |
  text := stringOrText asText.
 
+ text hasColorAttribute ifFalse: [
- text unembellished ifTrue: [
  text addAttribute: (TextColor color: (self userInterfaceTheme textColor ifNil: [Color black]))].
+ text hasFontAttribute ifFalse: [
+ text addAttribute: (TextFontReference toFont: (self userInterfaceTheme font ifNil: [TextStyle defaultFont]))].
-
- text addAttribute: (TextFontReference toFont: (self userInterfaceTheme font ifNil: [TextStyle defaultFont])).
 
  self textMorph wrapFlag: false.
  self textMorph newContents: text.
  self textMorph fullBounds.
 
  (self maximumWidth > 0 and: [self textMorph width > self maximumWidth])
  ifTrue: [
  self textMorph
  wrapFlag: true;
  width: self maximumWidth].
 
  self updateLayout.!

Item was added:
+ ----- Method: NewBalloonMorph>>updateColorsForBalloonOwner (in category 'updating') -----
+ updateColorsForBalloonOwner
+
+ self color: self balloonOwner balloonColor.
+
+ "If the balloon owner has a custom balloon color, derive the balloon border color from it."
+ self flag: #refactor. "mt: Add #balloonBorderColor *width etc. to Morph."
+ (self balloonOwner hasProperty: #balloonColor)
+ ifTrue: [self borderColor: (self color adjustBrightness: -0.2)].!