Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1381.mcz ==================== Summary ==================== Name: Morphic-mt.1381 Author: mt Time: 21 December 2017, 9:38:42.096231 am UUID: 321085c7-e49e-5448-a92d-750a4024ff5f Ancestors: Morphic-mt.1380 Makes TransferMorph using UI themes. =============== Diff against Morphic-mt.1380 =============== Item was changed: ----- Method: Object>>asDraggableMorph (in category '*morphic') ----- asDraggableMorph "Converts the receiver into a Morph suitable for dragging" ^(StringMorph contents: ( (self respondsTo: #dragLabel) ifTrue:[self dragLabel] ifFalse:[self printString])) + color: ((self userInterfaceTheme get: #textColor for: #TransferMorph) ifNil: [Color black]); + font: ((self userInterfaceTheme get: #font for: #TransferMorph) ifNil: [TextStyle defaultFont]) - color: Color white; yourself! Item was changed: ----- Method: Text>>asDraggableMorph (in category '*Morphic-converting') ----- asDraggableMorph + + ^ self copy + addAttribute: (TextFontReference toFont: ((self userInterfaceTheme get: #font for: #TransferMorph) ifNil: [TextStyle defaultFont])); + asMorph! - ^ self asMorph! Item was added: + ----- Method: TransferMorph>>applyUserInterfaceTheme (in category 'updating') ----- + applyUserInterfaceTheme + + super applyUserInterfaceTheme. + self setDefaultParameters.! Item was removed: - ----- Method: TransferMorph>>defaultColor (in category 'initialization') ----- - defaultColor - "answer the default color/fill style for the receiver" - ^ Color blue alpha: 0.4! Item was changed: ----- Method: TransferMorph>>initialize (in category 'initialization') ----- initialize super initialize. self changeTableLayout; listDirection: #leftToRight; hResizing: #shrinkWrap; vResizing: #shrinkWrap; layoutInset: 3; cellInset: 3; wrapCentering: #center; cellPositioning: #leftCenter; setProperty: #indicateKeyboardFocus toValue: #never. self doMove. self on: #keyStroke send: #keyStroke: to: self. self on: #keyUp send: #updateFromUserInputEvent: to: self. + self on: #keyDown send: #updateFromUserInputEvent: to: self. + + self setDefaultParameters.! - self on: #keyDown send: #updateFromUserInputEvent: to: self.! Item was changed: ----- Method: TransferMorph>>passenger: (in category 'accessing') ----- passenger: anObject passenger := anObject. self removeAllMorphs; addMorph: passenger asDraggableMorph; + updateCopyIcon; + setDefaultParameters.! - updateCopyIcon.! Item was added: + ----- Method: TransferMorph>>setDefaultParameters (in category 'initialization') ----- + setDefaultParameters + + self + borderWidth: (self userInterfaceTheme borderWidth ifNil: [1]); + borderColor: (self userInterfaceTheme borderColor ifNil: [Color r: 0.46 g: 0.46 b: 0.353]); + color: (self userInterfaceTheme color ifNil: [Color r: 0.92 g: 0.92 b: 0.706]); + cornerStyle: (MenuMorph roundedMenuCorners ifTrue: [#rounded] ifFalse: [#square]). + + self updateGradient.! Item was added: + ----- Method: TransferMorph>>updateGradient (in category 'updating') ----- + updateGradient + + | cc fill | + + MenuMorph gradientMenu ifFalse: [^ self]. + + self fullBounds. + + cc := self color. + fill := GradientFillStyle ramp: { + 0.0 -> Color white. + 0.10 -> (cc mixed: 0.5 with: Color white). + 0.5 -> cc. + 0.8 -> cc twiceDarker}. + fill + origin: self topLeft; + direction: 0@self height. + self fillStyle: fill.! |
Free forum by Nabble | Edit this page |