-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1383 from pharo-spec/dev-1.0
last changes
- Loading branch information
Showing
13 changed files
with
167 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/Spec2-Adapters-Morphic/SpStyleEnvironmentColorProxy.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
" | ||
Environment colors can change if we change the morphic theme, in that case we need to be able to react to `themeChanged` message, which will repaint the morphic components using the new values. | ||
To be able to react this, when declaring the usage of an environment-based color (see `SpStyleEnvironmentColorVariable`), we actually set up a proxy to a color, that will access the real color from the theme when needed. | ||
This is used exclusively in `SpStyleEnvironmentColorVariable>>#value` | ||
" | ||
Class { | ||
#name : #SpStyleEnvironmentColorProxy, | ||
#superclass : #ProtoObject, | ||
#instVars : [ | ||
'colorSelector' | ||
], | ||
#category : #'Spec2-Adapters-Morphic-StyleSheet' | ||
} | ||
|
||
{ #category : #converting } | ||
SpStyleEnvironmentColorProxy >> asStyleVariable [ | ||
|
||
^ SpStyleVariable newValue: self | ||
] | ||
|
||
{ #category : #accessing } | ||
SpStyleEnvironmentColorProxy >> colorSelector: aSelector [ | ||
|
||
colorSelector := aSelector | ||
] | ||
|
||
{ #category : #'reflective operations' } | ||
SpStyleEnvironmentColorProxy >> doesNotUnderstand: aMessage [ | ||
|
||
aMessage crTrace. | ||
^ aMessage sendTo: (Smalltalk ui theme perform: colorSelector) | ||
] | ||
|
||
{ #category : #accessing } | ||
SpStyleEnvironmentColorProxy >> yourself [ | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters