Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1064.mcz ==================== Summary ==================== Name: Morphic-mt.1064 Author: mt Time: 13 January 2016, 8:53:36.98468 am UUID: 90ae0497-e619-4289-abf1-602c0895cc4e Ancestors: Morphic-eem.1063 Fixes some hard-coded values in new-style balloon morphs. That is, make default text color configurable and the drop shadow react to #menuAppearance3d just like everywhere else. =============== Diff against Morphic-eem.1063 =============== Item was changed: + ----- Method: BalloonMorph class>>balloonColor (in category 'preferences') ----- - ----- Method: BalloonMorph class>>balloonColor (in category 'utility') ----- balloonColor + + <preference: 'Balloon background color' + categoryList: #(Morphic colors) + description: 'Specifies the background of balloon tips.' + type: #Color> + + ^ BalloonColor ifNil: [(TranslucentColor r: 0.92 g: 0.92 b: 0.706 alpha: 0.749)]! - ^ BalloonColor! Item was added: + ----- Method: BalloonMorph class>>balloonColor: (in category 'preferences') ----- + balloonColor: aColor + + BalloonColor := aColor.! Item was removed: - ----- Method: BalloonMorph class>>setBalloonColorTo: (in category 'utility') ----- - setBalloonColorTo: aColor - aColor ifNotNil: [BalloonColor := aColor]! Item was changed: Morph subclass: #NewBalloonMorph instanceVariableNames: 'balloonOwner textMorph maximumWidth orientation hasTail' + classVariableNames: 'DefaultBalloonTextColor UseNewBalloonMorph' - classVariableNames: 'UseNewBalloonMorph' poolDictionaries: '' category: 'Morphic-Widgets'! !NewBalloonMorph commentStamp: 'mt 3/31/2015 10:15' prior: 0! A balloon is a bubble with an optional tail. It contains rich text, which describes something about its balloon-owner.! Item was added: + ----- Method: NewBalloonMorph class>>defaultBalloonTextColor (in category 'preferences') ----- + defaultBalloonTextColor + + <preference: 'Default balloon text color' + categoryList: #(Morphic colors) + description: 'Specifies the default text color if no color information is provided via text attributes such as for plain strings. Otherwise the color information from the text attributes is used.' + type: #Color> + ^ DefaultBalloonTextColor ifNil: [Color black]! Item was added: + ----- Method: NewBalloonMorph class>>defaultBalloonTextColor: (in category 'preferences') ----- + defaultBalloonTextColor: color + + DefaultBalloonTextColor := color.! Item was changed: ----- Method: NewBalloonMorph>>defaultBorderWidth (in category 'initialization') ----- defaultBorderWidth + ^ MenuMorph menuBorderWidth! - ^ 1! Item was changed: ----- Method: NewBalloonMorph>>initialize (in category 'initialization') ----- initialize super initialize. self borderWidth: self defaultBorderWidth; borderColor: self defaultBorderColor; + color: (Preferences menuAppearance3d + ifTrue: [self defaultColor alpha: 1.0] + ifFalse: [self defaultColor]); + hasDropShadow: Preferences menuAppearance3d; - color: (self defaultColor alpha: 1.0); "no alpha due to drop shadow" - hasDropShadow: true; shadowOffset: 1@1; shadowColor: (self color muchDarker muchDarker alpha: 0.333); orientation: #bottomLeft. MenuMorph roundedMenuCorners ifTrue: [self cornerStyle: #rounded]. textMorph := TextMorph new wrapFlag: false; lock; yourself. self addMorph: textMorph.! Item was changed: ----- Method: NewBalloonMorph>>setText: (in category 'initialization') ----- setText: stringOrText | text | text := stringOrText asText. + + text unembellished ifTrue: [ + text addAttribute: (TextColor color: self class defaultBalloonTextColor)]. + text addAttribute: (TextFontReference toFont: (self balloonOwner ifNil: [BalloonMorph]) balloonFont). 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.! |
Free forum by Nabble | Edit this page |