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

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

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

Name: Morphic-mt.1215
Author: mt
Time: 31 July 2016, 11:34:33.618418 am
UUID: 73cf8a9d-c030-5f48-a2de-6bf45a687362
Ancestors: Morphic-mt.1214

*** Widget Refactorings and UI Themes (Part 10 of 11) ***

Drop shadow theme support and keyboard focus color theme support.

=============== Diff against Morphic-mt.1214 ===============

Item was added:
+ ----- Method: Morph class>>themeProperties (in category 'preferences') -----
+ themeProperties
+
+ | catName |
+ catName := 'Other'.
+
+ ^{
+ { #hardShadowColor. catName.  'The color of shadows. An alpha about 0.5 is recommended.' }.
+ { #hardShadowOffset. catName. 'The offset of the shadows behind the morph.' } .
+ { #softShadowColor. catName.  'The color of soft shadows. An alpha less than 0.05 is recommended.' }.
+ { #softShadowOffset. catName. 'The offset of soft shadows behind the morph.' } .
+ { #keyboardFocusColor. catName. 'The color of the keyboard focus indication.' }.
+ { #keyboardFocusWidth. catName. 'The width of the keyboard focus indication.' }.
+ }!

Item was changed:
  ----- Method: Morph class>>useSoftDropShadow: (in category 'preferences') -----
  useSoftDropShadow: aBoolean
 
  UseSoftDropShadow = aBoolean ifTrue: [^ self].
  UseSoftDropShadow := aBoolean.
 
  SystemWindow refreshAllWindows.
+ DialogWindow refreshAllDialogs.
  SystemProgressMorph reset.
  TheWorldMainDockingBar updateInstances.!

Item was changed:
  ----- Method: Morph>>addDropShadow (in category 'drop shadows') -----
  addDropShadow
 
+ self
+ hasDropShadow: true;
+ shadowOffset: (self useSoftDropShadow
+ ifTrue: [self userInterfaceTheme softShadowOffset ifNil: [10@8 corner: 10@12]]
+ ifFalse: [self userInterfaceTheme hardShadowOffset ifNil: [1@1]]);
+ shadowColor: (self useSoftDropShadow
+ ifTrue: [self userInterfaceTheme softShadowColor ifNil: [Color black alpha: 0.01]]
+ ifFalse: [self userInterfaceTheme hardShadowColor ifNil: [Color black alpha: 0.5]]).!
- self hasDropShadow: true.
-
- self useSoftDropShadow
- ifFalse: [
- self
- shadowOffset: 3@3;
- shadowColor: (Color black alpha: 0.5)]
- ifTrue: [
- self
- shadowOffset: (10@8 corner: 10@12);
- shadowColor: (Color black alpha: 0.01)].!

Item was added:
+ ----- Method: Morph>>applyUserInterfaceTheme (in category 'updating') -----
+ applyUserInterfaceTheme
+
+ "Re-initialize the shadow. Ensure shadow cache invalidation."
+ self hasDropShadow ifTrue: [
+ self addDropShadow.
+ self removeProperty: #dropShadow.
+ self changed].!

Item was changed:
  ----- Method: Morph>>drawKeyboardFocusIndicationOn: (in category 'drawing') -----
  drawKeyboardFocusIndicationOn: aCanvas
 
  self wantsRoundedCorners
+ ifTrue: [aCanvas frameRoundRect: self bounds radius: self cornerRadius width: self keyboardFocusWidth color: self keyboardFocusColor]
+ ifFalse: [aCanvas frameRectangle: self bounds width: self keyboardFocusWidth color: self keyboardFocusColor].!
- ifTrue: [aCanvas frameRoundRect: self bounds radius: self cornerRadius width: 3 "self borderStyle width" color: self keyboardFocusColor]
- ifFalse: [aCanvas frameRectangle: self bounds width: 3  "self borderStyle width" color: self keyboardFocusColor].!

Item was changed:
  ----- Method: Morph>>keyboardFocusColor (in category 'drawing') -----
  keyboardFocusColor
 
+ ^ self userInterfaceTheme keyboardFocusColor ifNil: [TranslucentColor r: 0.3 g: 0.5 b: 0.5 alpha: 0.5]!
- ^ Preferences keyboardFocusColor muchDarker alpha: 0.5!

Item was added:
+ ----- Method: Morph>>keyboardFocusWidth (in category 'drawing') -----
+ keyboardFocusWidth
+
+ ^ self userInterfaceTheme keyboardFocusWidth ifNil: [3]!

Item was changed:
  ----- Method: Morph>>shadowOffset: (in category 'drop shadows') -----
  shadowOffset: aPoint
  "Set the current shadow offset"
 
  self shadowOffset = aPoint ifTrue: [^ self].
  self changed.
 
  (aPoint isNil or: [ aPoint isZero ])
  ifTrue:[self removeProperty: #shadowOffset]
  ifFalse:[self setProperty: #shadowOffset toValue: aPoint].
 
+ self removeProperty: #dropShadow.
  self layoutChanged.
  self changed.!