The Trunk: System-mt.853.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-mt.853.mcz

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

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

Name: System-mt.853
Author: mt
Time: 31 July 2016, 10:54:53.47549 am
UUID: 51cc93f8-a4bd-3c46-87c6-509e16783c2b
Ancestors: System-mt.852

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

Prepare Shout syntax highlighting for UI themes. (Temporarily no syntax highlighting. Sorry. Be patient.)

=============== Diff against System-mt.852 ===============

Item was added:
+ ----- Method: TextDiffBuilder class>>applyUserInterfaceTheme (in category 'preferences') -----
+ applyUserInterfaceTheme
+
+ NormalTextAttributes := nil.
+ InsertTextAttributes := nil.
+ RemoveTextAttributes := nil.!

Item was added:
+ ----- Method: TextDiffBuilder class>>canApplyThemeToInstances (in category 'preferences') -----
+ canApplyThemeToInstances
+ ^ false!

Item was removed:
- ----- Method: TextDiffBuilder class>>initialize (in category 'class initialization') -----
- initialize
-
- self initializeTextAttributes!

Item was removed:
- ----- Method: TextDiffBuilder class>>initializeTextAttributes (in category 'class initialization') -----
- initializeTextAttributes
-
- InsertTextAttributes := { TextColor red }.
- RemoveTextAttributes := { TextEmphasis struckOut. TextColor blue }.
- NormalTextAttributes :={ TextEmphasis normal }
- !

Item was added:
+ ----- Method: TextDiffBuilder class>>themeProperties (in category 'preferences') -----
+ themeProperties
+
+ ^ {
+ { #insertTextAttributes. 'Styling'. 'Text attributes to use when a patch was inserted.' }.
+ { #normalTextAttributes. 'Styling'. 'Text attributes to use when text did not change.' }.
+ { #removeTextAttributes. 'Styling'. 'Text attributes to use when a patch was removed.' }.
+ }!

Item was added:
+ ----- Method: TextDiffBuilder>>applyUserInterfaceTheme (in category 'updating') -----
+ applyUserInterfaceTheme
+ "My class-side cache is invalidated there. My dependents have to invoke my services again."!

Item was changed:
  ----- Method: TextDiffBuilder>>buildDisplayPatch (in category 'creating patches') -----
  buildDisplayPatch
 
  | stream |
  stream := AttributedTextStream new.
+
+ "Lazy initialize the text attributes cache."
+ NormalTextAttributes ifNil: [NormalTextAttributes := self userInterfaceTheme normalTextAttributes
+ ifNil: [{TextEmphasis normal}]].
+ InsertTextAttributes ifNil: [InsertTextAttributes := self userInterfaceTheme insertTextAttributes
+ ifNil: [{TextColor red}]].
+ RemoveTextAttributes ifNil: [RemoveTextAttributes := self userInterfaceTheme removeTextAttributes
+ ifNil: [{TextEmphasis struckOut. TextColor blue}]].
+
  self
  patchSequenceDoIfMatch: [ :string |
  self print: string withAttributes: NormalTextAttributes on: stream ]
  ifInsert: [ :string |
  self print: string withAttributes: InsertTextAttributes on: stream ]
  ifRemove: [ :string |
  self print: string withAttributes: RemoveTextAttributes on: stream ].
  ^stream contents!