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

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

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

Name: Morphic-mt.1232
Author: mt
Time: 5 August 2016, 9:22:12.860358 am
UUID: 2ba4947f-a05c-8545-95e4-5d6b8b470a52
Ancestors: Morphic-mt.1231

Old-style balloon morph should be themeable, too. I heard so. :-)

=============== Diff against Morphic-mt.1231 ===============

Item was changed:
  ----- Method: BalloonMorph class>>balloonColor (in category 'preferences') -----
  balloonColor
 
  self flag: #remove. "mt: We should remove this additional getter  in the future and use UI themes instead:"
+ ^ (UserInterfaceTheme current get: #color for: #BalloonMorph) ifNil: [(TranslucentColor r: 0.92 g: 0.92 b: 0.706 alpha: 0.749)]!
- ^ (UserInterfaceTheme current get: #color for: #NewBalloonMorph) ifNil: [(TranslucentColor r: 0.92 g: 0.92 b: 0.706 alpha: 0.749)]!

Item was changed:
  ----- Method: BalloonMorph class>>balloonColor: (in category 'preferences') -----
  balloonColor: aColor
 
  self flag: #remove. "mt: We should remove this additional setter in the future and use UI themes instead:"
+ UserInterfaceTheme current set: #color for: #BalloonMorph to: aColor.!
- UserInterfaceTheme current set: #color for: #NewBalloonMorph to: aColor.!

Item was changed:
  ----- Method: BalloonMorph class>>balloonFont (in category 'utility') -----
  balloonFont
 
  self flag: #remove. "mt: We should remove this additional getter  in the future and use UI themes instead:"
+ ^ (UserInterfaceTheme current get: #font for: #BalloonMorph) ifNil: [TextStyle defaultFont]!
- ^ (UserInterfaceTheme current get: #font for: #NewBalloonMorph) ifNil: [TextStyle defaultFont]!

Item was added:
+ ----- Method: BalloonMorph class>>balloonTextColor (in category 'preferences') -----
+ balloonTextColor
+
+ self flag: #remove. "mt: We should remove this additional getter  in the future and use UI themes instead:"
+ ^ (UserInterfaceTheme current get: #textColor for: #BalloonMorph) ifNil: [Color black]!

Item was added:
+ ----- Method: BalloonMorph class>>balloonTextColor: (in category 'preferences') -----
+ balloonTextColor: aColor
+
+ self flag: #remove. "mt: We should remove this additional setter in the future and use UI themes instead:"
+ UserInterfaceTheme current set: #textColor for: #BalloonMorph to: aColor.!

Item was changed:
  ----- Method: BalloonMorph class>>getTextMorph:for: (in category 'private') -----
  getTextMorph: aStringOrMorph for: balloonOwner
  "Construct text morph."
  | m text |
  aStringOrMorph isMorph
  ifTrue: [m := aStringOrMorph]
  ifFalse: [BalloonFont
  ifNil: [text := aStringOrMorph]
+ ifNotNil: [text := aStringOrMorph asText
+ addAttribute: (TextFontReference toFont: balloonOwner balloonFont);
+ addAttribute: (TextColor color: self balloonTextColor)].
- ifNotNil: [text := Text
- string: aStringOrMorph
- attribute: (TextFontReference toFont: balloonOwner balloonFont)].
  m := (TextMorph new contents: text) centered].
  m setToAdhereToEdge: #adjustedCenter.
  ^ m!

Item was changed:
  ----- Method: BalloonMorph class>>setBalloonFontTo: (in category 'utility') -----
  setBalloonFontTo: aFont
 
  self flag: #remove. "mt: We should remove this additional setter in the future and use UI themes instead:"
+ UserInterfaceTheme current set: #font for: #BalloonMorph to: aFont.!
- UserInterfaceTheme current set: #font for: #NewBalloonMorph to: aFont.!

Item was added:
+ ----- Method: BalloonMorph class>>themeProperties (in category 'preferences') -----
+ themeProperties
+
+ ^ super themeProperties, {
+ { #borderColor. 'Colors'. 'Color of the balloon''s border.' }.
+ { #borderWidth. 'Borders'. 'Width of the balloon''s border.' }.
+ { #color. 'Colors', 'Color for the balloon background.' }.
+ { #font. 'Fonts'. 'Font for balloon text if not overridden by text attributes.' }.
+ { #textColor. 'Colors'. 'Color for the balloon text if not overridden by text attributes.' }.
+ }!

Item was added:
+ ----- Method: BalloonMorph>>applyUserInterfaceTheme (in category 'updating') -----
+ applyUserInterfaceTheme
+
+ super applyUserInterfaceTheme.
+ self setDefaultParameters.!

Item was removed:
- ----- Method: BalloonMorph>>defaultBorderColor (in category 'initialization') -----
- defaultBorderColor
- ^ self userInterfaceTheme borderColor ifNil: [self defaultColor muchDarker]!

Item was removed:
- ----- Method: BalloonMorph>>defaultBorderWidth (in category 'initialization') -----
- defaultBorderWidth
- ^ self userInterfaceTheme borderWidth ifNil: [0]!

Item was removed:
- ----- Method: BalloonMorph>>defaultColor (in category 'initialization') -----
- defaultColor
- "answer the default color/fill style for the receiver"
- ^ self userInterfaceTheme color ifNil: [self class balloonColor]!

Item was changed:
  ----- Method: BalloonMorph>>initialize (in category 'initialization') -----
  initialize
  "initialize the state of the receiver"
  super initialize.
  ""
  self beSmoothCurve.
 
+ offsetFromTarget := 0 @ 0.
+
+ self setDefaultParameters.!
- offsetFromTarget := 0 @ 0!

Item was added:
+ ----- Method: BalloonMorph>>setDefaultParameters (in category 'initialization') -----
+ setDefaultParameters
+
+ self
+ borderWidth: (self userInterfaceTheme borderWidth ifNil: [0]);
+ borderColor: (self userInterfaceTheme borderColor ifNil: [Color black]);
+ color: (self userInterfaceTheme color ifNil: [TranslucentColor r: 0.92 g: 0.92 b: 0.706 alpha: 0.749]).!