[squeak-dev] The Trunk: Morphic-cmm.1230.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Aug 5 04:46:42 UTC 2016
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.1230.mcz
==================== Summary ====================
Name: Morphic-cmm.1230
Author: cmm
Time: 4 August 2016, 11:45:46.19494 pm
UUID: 75ecc9d2-3132-4933-ba03-98810bd1e903
Ancestors: Morphic-pre.1229
Community Dark Theme.
=============== Diff against Morphic-pre.1229 ===============
Item was changed:
----- Method: BalloonMorph class>>string:for:corner: (in category 'instance creation') -----
string: str for: morph corner: cornerName
"Make up and return a balloon for morph. Find the quadrant that
clips the text the least, using cornerName as a tie-breaker. tk 9/12/97"
+ | text vertices balloon |
+ balloon := self new.
+ text := self
- | tm vertices |
- tm := self
getTextMorph: (str asString withNoLineLongerThan: Preferences maxBalloonHelpLineLength)
for: morph.
+ balloon userInterfaceTheme textColor ifNotNil:
+ [:col | text color: col].
+ balloon userInterfaceTheme font ifNotNil: [ : font | text font: font ].
+ vertices := self getVertices: text bounds.
- vertices := self getVertices: tm bounds.
vertices := self
+ getBestLocation: vertices
+ for: morph
+ corner: cornerName.
+ ^ balloon
+ color: morph balloonColor ;
+ setVertices: vertices ;
+ addMorph: text ;
- getBestLocation: vertices
- for: morph
- corner: cornerName.
- ^ self new color: morph balloonColor;
- setVertices: vertices;
- addMorph: tm;
setTarget: morph!
Item was changed:
----- Method: BalloonMorph>>defaultBorderColor (in category 'initialization') -----
defaultBorderColor
+ ^ self userInterfaceTheme borderColor ifNil: [self defaultColor muchDarker]!
- "answer the default border color/fill style for the receiver"
- ^ self defaultColor muchDarker"Color black"!
Item was changed:
----- Method: BalloonMorph>>defaultBorderWidth (in category 'initialization') -----
defaultBorderWidth
+ ^ self userInterfaceTheme borderWidth ifNil: [0]!
- "0 is appropriate for balloons because they are transient and wispy, not a solid object deserving a border."
- ^ 0!
Item was changed:
----- Method: BalloonMorph>>defaultColor (in category 'initialization') -----
defaultColor
"answer the default color/fill style for the receiver"
+ ^ self userInterfaceTheme color ifNil: [self class balloonColor]!
- ^ self class balloonColor!
Item was changed:
----- Method: BalloonMorph>>popUp (in category 'initialization') -----
popUp
-
| w worldBounds |
-
target ifNil: [^ self].
target isInWorld ifFalse: [^ self].
-
w := target world.
+ self prepareToOpen.
+ "So that if the translation below makes it overlap the receiver, it won't interfere with the rootMorphsAt: logic and hence cause flashing. Without this, flashing happens, believe me!!"
-
- self lock.
- self fullBounds. "force layout"
- self setProperty: #morphicLayerNumber toValue: self morphicLayerNumber.
- "So that if the translation below makes it overlap the receiver, it won't
- interfere with the rootMorphsAt: logic and hence cause flashing. Without
- this, flashing happens, believe me!!"
((worldBounds := w bounds) containsRect: self bounds) ifFalse:
[self bounds: (self bounds translatedToBeWithin: worldBounds)].
-
self openInWorld.
w activeHand addBalloonHelp: self.
!
Item was changed:
----- Method: BalloonMorph>>popUpForHand: (in category 'initialization') -----
popUpForHand: aHand
"Pop up the receiver as balloon help for the given hand"
| worldBounds |
+ self prepareToOpen.
-
- self lock.
- self fullBounds. "force layout"
- self setProperty: #morphicLayerNumber toValue: self morphicLayerNumber.
aHand world addMorphFront: self.
"So that if the translation below makes it overlap the receiver, it won't
interfere with the rootMorphsAt: logic and hence cause flashing. Without
this, flashing happens, believe me!!"
((worldBounds := aHand world bounds) containsRect: self bounds) ifFalse:
[self bounds: (self bounds translatedToBeWithin: worldBounds)].
aHand resetBalloonHelp: self.
!
Item was added:
+ ----- Method: BalloonMorph>>prepareToOpen (in category 'private') -----
+ prepareToOpen
+ "Override the color if not already set."
+ self userInterfaceTheme color ifNotNil: [ : col | self color: col].
+ self
+ lock ;
+ fullBounds ;
+ setProperty: #morphicLayerNumber
+ toValue: self morphicLayerNumber!
Item was changed:
----- Method: MenuItemMorph>>isEnabled: (in category 'accessing') -----
+ isEnabled: aBoolean
- isEnabled: aBoolean
-
isEnabled = aBoolean ifTrue: [^ self].
isEnabled := aBoolean.
+ self color:
+ (self userInterfaceTheme perform:
+ (aBoolean
+ ifTrue: [#textColor]
+ ifFalse: [#disabledTextColor]))!
- self color: (aBoolean ifTrue: [Color black] ifFalse: [Color lightGray]).
- !
Item was changed:
----- Method: PluggableTextMorph>>drawFrameAdornment:on: (in category 'drawing') -----
drawFrameAdornment: aColor on: aCanvas
"Indicate edit status for the text editor"
self class simpleFrameAdornments
ifTrue:
[ aCanvas
frameRectangle: self innerBounds
+ width: (self userInterfaceTheme frameAdornmentWidth ifNil: [1])
- width: 1
color: aColor.
aCanvas
frameRectangle: (self innerBounds insetBy: 1)
+ width: (self userInterfaceTheme frameAdornmentWidth ifNil: [1])
- width: 1
color: (aColor alpha: aColor alpha / 3.0) ]
ifFalse:
[ | form |
"Class-side adornment cache is currently using pre-multiplied alpha, so we need to use rule 34 which works for < 32bpp, too."
form := self class adornmentWithColor: aColor.
aCanvas
image: form
at: self innerBounds topRight - (form width @ 0)
sourceRect: form boundingBox
rule: 34 ]!
Item was changed:
----- Method: SearchBar>>scratchPad (in category 'accessing') -----
scratchPad
^ scratchPad ifNil:
[ scratchPad := TextMorphForEditView new. "we should be able to use TextMorph here; fix later"
scratchPad
" on: #keyboardFocusChange send: #removeScratchPad to: self ;"
on: #mouseLeave send: #removeScratchPad to: self ;
on: #keyStroke send: #handleScratchPadKey: to: self ;
margins: (5 at 0 corner: 5 at 0);
backgroundColor: (BalloonMorph balloonColor alpha: 1.0) ;
setEditView: PluggableTextMorph new ; "dummy"
autoFit: true ;
wrapFlag: true ;
newContents: '--scratch area--' ;
font: ((UserInterfaceTheme current get: #font for: #PluggableTextMorph) ifNil: [TextStyle defaultFont]);
textColor: ((UserInterfaceTheme current get: #textColor for: #PluggableTextMorph) ifNil: [Color black]);
caretColor: ((UserInterfaceTheme current get: #caretColor for: #PluggableTextMorph) ifNil: [Color red]);
+ selectionColor: ((UserInterfaceTheme current get: #selectionColor for: #PluggableTextMorph) ifNil: [Color blue muchDarker] ifNotNil: [ : col | col twiceLighter ]);
- selectionColor: ((UserInterfaceTheme current get: #selectionColor for: #PluggableTextMorph) ifNil: [Color blue]) muchDarker;
yourself.
self layoutScratchPad.
Preferences menuAppearance3d ifTrue: [ scratchPad addDropShadow ].
scratchPad ]!
More information about the Squeak-dev
mailing list
|